diff options
Diffstat (limited to 'docs/reference/incoming_box.rst')
-rw-r--r-- | docs/reference/incoming_box.rst | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/docs/reference/incoming_box.rst b/docs/reference/incoming_box.rst index 04d3084c..920d03bf 100644 --- a/docs/reference/incoming_box.rst +++ b/docs/reference/incoming_box.rst @@ -230,22 +230,20 @@ registered Trusted Application Consumers. process, attention SHOULD be payed to the callbacks not blocking the main event loop. -Example of a Trusted Application Client Consumer: - -```python -@implementer(interfaces.IIncomingBoxConsumer) -class MyConsumer(object): - def __init__(self): - self.name = 'My Consumer' - - def process(self, item, item_id, encrypted=True): - cleartext = my_custom_decrypt(item) if encrypted else item - processed_parts = my_custom_processing(item) - return defer.succeed(processed_parts) - - def save(self, parts, item_id): - return defer.gatherResults([db.save(part) for part in parts]) -``` +Example of a Trusted Application Client Consumer:: + + @implementer(interfaces.IIncomingBoxConsumer) + class MyConsumer(object): + def __init__(self): + self.name = 'My Consumer' + + def process(self, item, item_id, encrypted=True): + cleartext = my_custom_decrypt(item) if encrypted else item + processed_parts = my_custom_processing(item) + return defer.succeed(processed_parts) + + def save(self, parts, item_id): + return defer.gatherResults([db.save(part) for part in parts]) Future Features |