mrozmanith / flexcairngorm

Automatically exported from code.google.com/p/flexcairngorm
0 stars 0 forks source link

EventGenerator breaks after first event in sequence #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Dispatch a SEQUENCE generator (implicitly or explicitly)

What is the expected output? What do you see instead?

Expect sequence, but the following code at the tail end of dispatchNext()
in EventGenerator breaks after the first event in the sequence is dispatched:

// Only break loop if firing a SINGLE event
if (this.trigger == TRIGGER_SEQUENCE) break;

What version of the product are you using? On what operating system?

svn updated this morning.

Please provide any additional information below.

Judging from the comment on the code up there, I can only guess that you
were thinking of creating a new trigger type of SINGLE .. no? If so, it
would make sense to break on (this.trigger == TRIGGER_SINGLE). As is, it
kills my sequence after the first of two events.

Commenting this out or changing TRIGGER_SEQUENCE to TRIGGER_SINGLE allows
my sequence continue as I expect.

Original issue reported on code.google.com by dylan.ol...@gmail.com on 6 May 2008 at 4:32

GoogleCodeExporter commented 8 years ago
Does "breaks" means that the second event does not get dispatched?

Remember that you have to call the generator callback from your command when
you're done to signal the generator to dispatch the next event; that's how it
is supposed to work works.

The generator dispatches UMEvents which have a callbacks
property which must implement IResponder.  IResponder has result and fault
methods which you use to signal that you are done with your command.  If your
event generator is running in sequence (that's the default configuration), you
have to run one of these methods from your command when you're finished with 
what you
were doing so that the EventGenerator can know that it can proceed with the
next event.   It will wait (on purpose) for you to run it method.

What you did with your change was turning your sequenced generator into a
parallel generator that doesn't have to wait for the callbacks to be run in
order to dispatch the next event; all the events get dispatched on the same
frame.  But to achieve that you should just change trigger property
from TRIGGER_SEQUENCE to TRIGGER_PARALLEL using the unchanged class.

Original comment by gabriel....@gmail.com on 13 May 2008 at 3:23

GoogleCodeExporter commented 8 years ago
Hi Gabriel,

regarding this event chaining question, I was wondering if
notifyCaller() could also be extended in order to handle the
callback to the EventGenerator from the command to trigger 
the next event instead of doing event.callback.result(). 
The notifyCaller() would the notify views but also the eventgenerator
if a callback is available in the event...
What do you think?

Thanks for any answer.
Cédric

Original comment by rackamth...@yahoo.com on 5 Nov 2008 at 9:03