Skip to content

Instantly share code, notes, and snippets.

@meejah meejah/eliot-test.py
Created Aug 17, 2017

Embed
What would you like to do?
from eliot import start_action
from eliot.twisted import DeferredContext
import eliot
from twisted.internet.task import react, deferLater
from twisted.internet.defer import _inlineCallbacks, Deferred
def thing(reactor):
with start_action(action_type=u"a thing"):
d = deferLater(reactor, 1.0, lambda: "thing a")
dc = DeferredContext(d)
dc.addActionFinish()
return d
def start_logging():
eliot.to_file(
open("eliot.log", "wb")
)
def main(reactor):
start_logging()
d = thing(reactor)
return d
if __name__ == '__main__':
react(main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.