Sorry, good call, Adam! @OnScheduled methods are completed before onTrigger is called. However, @OnUnscheduled could be called while your onTrigger method is executing.
Regarding the documentation of the lifecycle of Processors: this will be a major part of the Developer Guide that we are promising to put together. > Date: Thu, 15 Jan 2015 09:13:29 -0500 > Subject: Re: Stateful Processors > From: [email protected] > To: [email protected] > > On Thu, Jan 15, 2015 at 7:48 AM, Mark Payne <[email protected]> wrote: > > > Additionally, if you have methods annotated with @OnScheduled, > > @OnUnscheduled, etc., then these > > will be executed in a separate thread potentially while onTrigger is being > > executed. > > > > Ouch, really? You can't guarantee that your @OnScheduled method is > completed before your onTrigger() method is invoked? > > The whole point of @OnScheduled is to have a place to perform expensive > resource allocations on other onetime seteup needed before onTrigger is > even called. Saying that @OnScheduled doesn't finish before onTrigger is > called is probably a significant issue, since there are likely processors > relying on this ordering. > > Since it's come up many times in conversation, Mark do you think you could > include a full description of the entire lifecycle of a processor? This > would ideally include which methods or annotations are fired at what time, > which lifecycle "happens before" guarantees a processor developer can rely > on, etc.
