
Hello,
Just a few more questions about the subj :)
1. IIUC, in async_state_machine it's impossible to post an "internal"
event from a state by calling queue_event(), as noone will actually
call process_event(). Instead, it should be always done through the
processor queue, like this:
outermost_context_type &machine = outermost_context();
machine.my_scheduler().queue_event(machine.my_handle(), MyEvent());
Am I right?
2. Deferred events in async.machine. Say, we've got the following
states (simplified code):
struct State1 : simple_state<...>
{
typedef transition
reactions; }; Both events are queued to the machine from the "outer world". * We're already in State2. * We get a bunch of EvGotoState2 posted (eg., 10 events). All of them are queued to the state's deferred events queue. * EvGotoState1 comes. The machine goes to State1 and then immediately consumes 1 deferred EvGotoState2 and move to State2. What happens to the rest of the deferred events? Are they queued again to the deferral queue of State2? 3. Is it possible to clear all the deferred events? Is it possible to clear deferred events of a specific type? Eg., in State2 I'd like to alway defer only the *last* EvGotoState2, discarding all the previous deferred events of this type. Is it possible? Thanks a lot! Igor'.