Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async State Subscriptions #12

Closed
ztnel opened this issue Mar 22, 2022 · 0 comments · Fixed by #15
Closed

Async State Subscriptions #12

ztnel opened this issue Mar 22, 2022 · 0 comments · Fixed by #15
Assignees
Labels
core core feature implementation feature feature request

Comments

@ztnel
Copy link
Owner

ztnel commented Mar 22, 2022

Implement asynchronous state model level subscription where consumers can subscribe to a commit made to a specific state model. Subscriptions are implemented by passing a callback which accepts a single parameter for the new copy of the requested state model:

def __init__(self):       
   with State() as state:
      state.subscribe(User, self._schedule)

async def _schedule(self, user: User) -> None: ...
@ztnel ztnel added the core core feature implementation label Mar 22, 2022
@ztnel ztnel self-assigned this Mar 22, 2022
@ztnel ztnel added the feature feature request label Mar 22, 2022
@ztnel ztnel mentioned this issue Apr 4, 2022
3 tasks
@ztnel ztnel closed this as completed in #15 Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core core feature implementation feature feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant