-
Notifications
You must be signed in to change notification settings - Fork 3
Fix subscriber decorator bug #81
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
Conversation
This pull request has been linked to Shortcut Story #21922: TypeError trying to chain decorators. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thank you for clarifying the docstring and making the fix to the aysnc generator.
Subscribe to realtime events from a set of Ensign topics. This method returns | ||
an async generator that yields Event objects, so the `async for` syntax can be | ||
used to process events as they are received. To retrieve historical events, use | ||
the `query()` method instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subscribe to realtime events from a set of Ensign topics. This method returns | |
an async generator that yields Event objects, so the `async for` syntax can be | |
used to process events as they are received. To retrieve historical events, use | |
the `query()` method instead. | |
Subscribe to realtime events from a set of Ensign topics. This method returns | |
an async generator that yields Event objects, so the `async for` syntax can be | |
used to process events as they are published. To retrieve events published | |
before now, use the `query()` method instead. |
Execute an EnSQL query to retrieve historical events. This method returns a | ||
cursor that can be used to fetch the results of the query, via `fetchone()`, | ||
`fetchmany()`, or `fetchall()` methods. Alternatively, `async for` syntax can | ||
be used to iterate over the results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Execute an EnSQL query to retrieve historical events. This method returns a | |
cursor that can be used to fetch the results of the query, via `fetchone()`, | |
`fetchmany()`, or `fetchall()` methods. Alternatively, `async for` syntax can | |
be used to iterate over the results. | |
Execute an EnSQL query to retrieve events events from the topic no matter | |
when they were published. This method returns a cursor that can be used to | |
fetch the results of the query, via `fetchone()`, `fetchmany()`, or `fetchall()` | |
methods. Alternatively, `async for` syntax can be used to iterate over the | |
results. |
Well … I just merged the PR without merging the suggestions 🤦🏽 that was silly of me, sorry about that. If you like the suggestions, feel free to open a new PR and merge them in, otherwise don't worry about it. |
This PR fixes a bug where decorator chaining was not working, e.g. it should be possible to make a function both a subscriber and publisher:
Previously this raised a TypeError so I added a test for this and fixed the bug.
TODOs and questions
Still to do:
Questions for the @rotationalio/maintainers:
CHECKLIST
pytest
?