Skip to content

Commit

Permalink
Add extensibility to registry.Message in ancitipation of new features
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed Jun 17, 2021
1 parent 345857d commit 6b1a9f9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions huey/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
'priority', 'args', 'kwargs', 'on_complete',
'on_error'))

# Automatically set missing parameters to None. This is kind-of a hack, but it
# allows us to add new parameters while continuing to be able to handle
# messages enqueued with a smaller-set of arguments.
Message.__new__.__defaults__ = (None,) * len(Message._fields)


class Registry(object):
def __init__(self):
Expand Down

0 comments on commit 6b1a9f9

Please sign in to comment.