Handler

class obelus.common.Handler

A Handler holds callbacks which will be called when an ongoing operation terminates. Also known as Future, Promise, Deferred, etc.

Generally, you won’t create Handler objects yourself. Instead, a producer will create it for you, and you will set the on_result and on_exception attributes to be notified of the output of the operation.

classmethod aggregate(handlers)

Return a new Handler which will trigger when all the given handlers have successfully fired, or when one of them fails.

on_exception

Failure callback. Will be called with the handler’s exception if the underlying operation failed.

on_result

Success callback. Will be called with the handler’s result if the underlying operation was successful.