public void feed ( ) { if ( source . hasNext ( ) ) { Event < ? > event = source . getNext ( ) ; FeedContext context = new FeedContext ( event ) ; FeedTrigger trigger = new FeedTrigger ( ) ; trigger . setNextFireTime ( event . getDate ( ) ) ; FeedJob job = new FeedJob ( source , sink , trigger , clock ) ; clock . scheduleJob ( job , context , trigger ) ; } }
For this simple demo we are loading the whole stream of events into the memory .