Skip to content

Instantly share code, notes, and snippets.

@prologic
Created September 30, 2016 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prologic/a8c5b7835d76130f175975260b9c34e8 to your computer and use it in GitHub Desktop.
Save prologic/a8c5b7835d76130f175975260b9c34e8 to your computer and use it in GitHub Desktop.
$ python
Python 2.7.11 (default, Dec 26 2015, 17:47:53)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from circuits import Component, Event
>>> class App(Component):
... def foo(self):
... return self.fire(Event.create("bar"))
... def bar(self):
... return "Hello World!"
...
>>> app = App()
>>> app.start()
(<Thread(App, started daemon 123145306509312)>, None)
>>> x = app.fire(Event.create("foo"))
>>> x
<Value ('Hello World!') result=True; errors=False; for <foo[*] ( )>>
>>> y = app.fire(Event.create("foo")); y.value
>>> y
<Value ('Hello World!') result=True; errors=False; for <foo[*] ( )>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment