Comments (4)
Hi!
does it mean that any messages sent to the channels they subscribed to will be discarded until step 6 is done?
No. If SObjectizer works correctly (I hope it does mostly) then agent will accept messages since steps 3 and 4 complete. When agent gets its event_queue from the dispatcher (at step 3) all messages sent to that agent will go to the agent's queue.
It allows to have logic like that: agents A and B are placed into the same coop (but bound to different dispatchers), agent A sends a message M to agent B in A's so_evt_start. The B will receive that message even if B's so_evt_start isn't called by the B's dispatcher. And all those actions could happen just inside register_coop.
Related: does the same hold for introduce_child_coop?
Yes. introduce_child_coop
is just a handy wrapper around introduce_coop
.
from sobjectizer.
Thanks for the clarification!
In my scenario, I am only interested that my agents do not miss any messages. Starting to process such messages later is totally fine for me.
Imagine that all my agents subscribe to a certain channel X
the typical way, that is inside so_define_agent
. They are all in their own cooperation (to be able to commit suicide, as we discussed in the old #28) that is under a common parent cooperation (just for convenience, since they can all be deregistered at once).
All such agents are registered in a function similar to that I mentioned before:
void Register(...)
{
so_5::introduce_child_coop(parent_coop, [&](so_5::coop_t& c) {
c.make_agent<...>(...);
});
}
Imagine something like this: a for loop that calls such Register function for every agent that needs to join the party.
Only after this for loop messages can start to arrive to that channel X
I was mentioning before.
Am I on the safe side? To be clear again: I am not interested that messages are processed straight after that for loop, just that messages are not discarded (and then processed later when agents actually start).
I think it's the case and mine is probably just a doubt - since SObjectizer works correctly :)
from sobjectizer.
It seems to me that you are on the safe side.
from sobjectizer.
It was just an unfounded doubt actually. Thanks @eao197 for your support and keep up with the great work!
from sobjectizer.
Related Issues (20)
- Documentation for message_holder_t has to be extended HOT 1
- A usage example for agent_t::limit_then_redirect method in API Reference HOT 1
- [Design] Your opinion on expressing agent intent HOT 2
- Deprecation of coop_t::deregister and coop_t::deregister_normally methods HOT 1
- [idea] An emergency stop of SOEnv on an exception in noexcept context HOT 1
- `so_evt_finish` not called until `so_evt_start` is running? HOT 2
- Should agent_t::so_drop_subscription* methods be marked as noexcept? HOT 1
- Should delivery filters be checked for noexcept-ness?
- bind_and_transform HOT 10
- so_5::details::make_message_instance_impl metafunction doesn't set message mutability flag properly HOT 1
- limit_then_transform for mutable messages HOT 1
- Allow `const auto &` as an argument for delivery filter in single/multi_sink_binding HOT 1
- Should there be agent_t::so_disp_binder() and agent_t::so_coop_default_disp_binder() methods? HOT 2
- [idea] Make so5extra's revocable timers the default implementation for timers in SObjectizer
- Another constructor for wrapped_env_t that waits completion of init-function HOT 1
- Use of message limits and state_t::time_limit
- Optional name for an agent? HOT 2
- New method `as_string_view` for so_5::stats::prefix_t and so_5::stats::suffix_t HOT 1
- SO_5_TYPE shouldn't be used for so_5::stats::messages::quantity
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 sobjectizer.