Skip to content

Commit

Permalink
feat(pyd): NoOpConsumer implementation.
Browse files Browse the repository at this point in the history
Signed-off-by: Braden Mars <bradenmars@bradenmars.me>
  • Loading branch information
BradenM committed Apr 17, 2023
1 parent a2187c8 commit 5a21ecd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions micropy/pyd/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,12 @@ class StreamHandlers(NamedTuple):

class MessageHandlers(NamedTuple):
on_message: MessageHandler


def _no_op(*args, **kwargs):
return None


NoOpStreamConsumer = StreamHandlers(on_start=_no_op, on_update=_no_op, on_end=_no_op)
NoOpMessageConsumer = MessageHandlers(on_message=_no_op)
NoOpConsumer = ConsumerDelegate(NoOpMessageConsumer, NoOpMessageConsumer)

0 comments on commit 5a21ecd

Please sign in to comment.