dfinity / examples

Example applications, microservices, and code samples for the Internet Computer
https://dfinity.org
Apache License 2.0
537 stars 353 forks source link

As a Developer, I want to Get Events so that My App Can React In Real Time #89

Closed justinmchase closed 2 months ago

justinmchase commented 3 years ago

Is your feature request related to a problem? Please describe. I'm looking at the Pub/Sub example and its pretty interesting but its just calling back to a subscriber class. If a user is running an app in a browser from a cannister it seems like it would need to poll the the subscriber function to look for updates. That's going to cost cycles and may infrequently change.

Describe the solution you'd like I'd like to see an api where you can subscribe to an event published by an actor and an active socket connection is established. The actor could then publish a message to that event and matching subscribers would receive a message pushed from dfx through the socket in real-time.

Describe alternatives you've considered Theoretically it could do something like support outbound webhook calls instead of requiring an active socket... that sounds worse for users behind firewalls but better for backend to backend. Maybe both would be good :)

Additional context I'm new, maybe this already exists but I didn't see it in the docs. Pushing messages out of the system seems like a pretty important foundational piece, other systems support it in various ways.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.