-
Notifications
You must be signed in to change notification settings - Fork 55
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
Producer/consumer model for creating streams #747
Comments
Might be better to call this On second thoughts, I think a better name is |
See ballerina-platform/ballerina-library#2821 (comment) for a discussion of why shutdown is difficult. I think we want to approach this by seeing channels as the module-level counterpart of the worker message passing. Worker message passing is not design to maximize expressiveness. It's designed so that it can be fully analyzed, allowing for diagrams, static checking, and deadlock prevention. There's special syntax and named workers are not first-class, i.e. cannot be passed round as values. |
Something like:
Channels would not be allowed to be public, so you can completely analyze what's going on. |
This ties into #736. |
I suspect prohibiting public channels would be too restrictive. The challenge then is how to make things analyzable without this restriction. |
In order to support event streams #440, we need to provide a producer/consumer model for creating streams. This requires a new abstraction, which I will call a
queue
: a producer strand (often started by a listener) can add to a queue; another strand can create stream from thequeue
, which it can use to process values added by producer strands to the queue.These streams will typically be unbounded. One of the design challenges here is to ensure that queues can participate properly in a graceful shutdown.
The text was updated successfully, but these errors were encountered: