Comments (5)
this needs tests obviously, but is there any reason this couldn't be merged?
https://github.com/talentdeficit/gen_stage/tree/async_events
from gen_stage.
The producer doesn't have to answer immediatialy. It is totally fine to
store the demand and serve that later on. That's why all callbacks can
potentially return events. The GenEvent example in the examples folder and
in the announcement does that.
The notification is used for other goals. You can check the Naiad project
from Microsoft, which is where we got the notifications from, but in
summary it can be used to notifiy consumers that the source has exhausted
or halted or to notify a new window of processing has started and so on. It
has the property of keep the ordering from events, even if those events
have been buffered somewhere.
On Thursday, July 14, 2016, alisdair sullivan [email protected]
wrote:
As far as I can tell if a consumer requests events the producer must
immediately return that many events in the handle_demand callback or the
producer has to drop down to the raw message protocol to send events
asynchronously. Otherwise the consumer has to issue another request in
order to ever receive any events.Is async_notify/sync_notify meant to be used for this purpose? how is an
callback module supposed to handle notify messages? raw interpretation of
the notify message in handle_info?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/elixir-lang/gen_stage/issues/38, or mute the thread
https://github.com/notifications/unsubscribe/AAAlbif8hfU0boQt_08NbWhv6FsrxleKks5qVn1PgaJpZM4JMtNC
.
José Valim
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D
from gen_stage.
To further expand, you never want to send events asynchronously because it
means we won't be able to track the demand and you will lose ordering in
case there are buffers. If you send events async, the consumer will
eventually complain it has gotten more events than it has asked for.
José Valim
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D
from gen_stage.
i understand now why i wouldn't want to send events directly to a client async and i guess if i want to produce events asynchronously i could use handle_call/3, thanks
from gen_stage.
@talentdeficit you would need to send those messages to the producer so it finally sends them downstream or figure out a way of having multiple producers so you could leverage concurrency from this other angle.
from gen_stage.
Related Issues (20)
- Link required for ConsumerSupervisor? HOT 3
- Change default child :restart to :transient in ConsumerSupervisor HOT 1
- Doc typo in min_demand paragraph HOT 2
- ** (FunctionClauseError) no function clause matching in GenStage.Streamer.handle_info/2 HOT 11
- Release 0.14.2? HOT 2
- Dialyzer Error In GenState.async_subscribe/2 HOT 1
- [Feature request] add from ref to handle_demand. HOT 1
- Dialyzer error in GenStage.sync_subscribe/3 when using custom options HOT 1
- Version 0.14.3 released? HOT 1
- Question about ConsumerSupervisor HOT 2
- Init callback return option :subscribe_to looks too restrictive HOT 9
- Compilation error due to lackness of GenStage dependency HOT 2
- New release HOT 4
- `Endpoint.config_change/2` causes `undefined handle_info` HOT 6
- Improve documentation for GenStage.PartitionDispatcher HOT 1
- Usage of rate-limiter example is unclear HOT 4
- no function clause matching in GenStage.maybe_producer_cancel/2 HOT 2
- Fix CI
- Issue changing demand on-the-fly HOT 3
- There is typo in docs of GenStage module.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gen_stage.