Comments (7)
Dynamic supervisor is in master. What is left to be implemented is marked as TODO in the code.
from gen_stage.
Given the DynamicSupervisor
is similar to :simple_one_for_one
, wouldn't it be better if it accepted just a single child specification instead of a list with just one element? It is my understanding that it doesn't make sense to pass multiple specs there.
from gen_stage.
@michalmuskala yes, I was torn about this decision but I see benefits in keeping the return types the same for both supervisors (i.e. always a list).
from gen_stage.
What benefits do you see in using a list (which as far as I understand will always have to have exactly one element)?
Also, will we have the "module-less supervisor", i.e. something like: DynamicSupervisor.start_link(child_spec, supervisor_opts)
?
from gen_stage.
@sasa1977 callback specifications, functions like Supervisor.Spec, anything else that works on childspecs will always expect the same type.
And yes, the module-less supervisor will be there.
from gen_stage.
The only such function I see there would be Supervisor.Spec.supervise
, which I don't think makes sense for dynamic supervisors anyway. Not only because it accepts multiple children, but also because it takes a strategy as an option (which doesn't make sense for dynamic supervisors). You'd again need conditionals in the docs to describe how is this used for static vs dynamic supervisor, so I'd say it's better to separate the two implementations. The dynamic one could then require a single child.
The remaining two functions can be shared between both supervisors, as they are not concerned with the child specification.
I'm still confused about "anything else that works on childspecs will always expect the same type". What else is out there?
from gen_stage.
A strategy will still be required for dynamic supervisors. It will ship
only with :one_for_one but we may add others in the future.
If in a couple years we don't add another strategy, we can remove this
requirement. It is always better to start with such requirements because
removing them later on is backwards compatible. If we don't enforce a
strategy option now and add a new strategy in the future, we won't be able
to enforce the option, as it would be backwards incompatible, and we will
regret not being explicit today.
I don't have any examples today of other strategies we may add (if I did
this decision would be much easier ;)). It still does not change the fact
the strategy option will be required (for now).
José Valimwww.plataformatec.com.br
http://www.plataformatec.com.br/Founder and Director of R&D
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.