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

http.subscribe_api_call #538

Open
robnagler opened this issue Dec 29, 2024 · 0 comments
Open

http.subscribe_api_call #538

robnagler opened this issue Dec 29, 2024 · 0 comments

Comments

@robnagler
Copy link
Member

robnagler commented Dec 29, 2024

API calls come in two styles:

  • call_api: send and wait for reply
  • subscribe_api: return APISubscription, reply(), destroy (will unsubscribe/cancel).

Updates are replies that do not terminate a subscription. An APIError on a subscription automatically terminates the subscription.

@quest.publisher is a decorator on APIs that allow subscriptions, which run until completion (in new task): calling publish_reply for updates (intermediate replies) and returning the final reply (if ever).

I suspect we'll want to introduce a "channel" concept, which is a Queue that returns events to the publisher so that it can be canceled (Queue.shutdown(immediate=True) or a PriorityQueue where cancel is high priority item).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant