hu.mta.sztaki.lpds.cloud.simulator
Class DeferredEvent.AggregatedEventDispatcher
java.lang.Object
hu.mta.sztaki.lpds.cloud.simulator.Timed
hu.mta.sztaki.lpds.cloud.simulator.DeferredEvent.AggregatedEventDispatcher
- All Implemented Interfaces:
- Comparable<Timed>
- Enclosing class:
- DeferredEvent
private static class DeferredEvent.AggregatedEventDispatcher
- extends Timed
handles the event aggregations, actual subscriptions to timed events and
dispatches the events if Timed notifies for time instance at which the
non-recurring events should be fired
Improves the performance of deferred events significantly if multiple
events should occur at once
- Author:
- "Gabor Kecskemeti, Laboratory of Parallel and Distributed Systems, MTA SZTAKI (c) 2015"
Method Summary |
void |
tick(long fires)
The actual event dispatcher. |
private void |
updateDispatcher()
after some deferred events are dispatched, this function actually
determines the next occurrence of a deferred event (and readjusts the
notification frequency for Timed) or if there are no further events
registered, the function cancels the notifications |
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.Timed |
calcTimeJump, compareTo, fire, getFireCount, getFrequency, getNextEvent, getNextFire, isSubscribed, jumpTime, nextEventDistance, resetTimed, setBackPreference, simulateUntil, simulateUntilLastEvent, skipEventsTill, subscribe, toString, unsubscribe, updateFrequency |
DeferredEvent.AggregatedEventDispatcher
private DeferredEvent.AggregatedEventDispatcher()
tick
public void tick(long fires)
- The actual event dispatcher. This function is called by Timed on the
time instance when the first not yet dispatched deferred event is
due.
Note: If multiple events must be delivered at a given time
instance, then the order of the dispatched events are undefined.
- Specified by:
tick
in class Timed
- Parameters:
fires
- The particular time instance when the function was called. The
time instance is passed so the tick functions will not need to
call getFireCount() if they need to operate on the actual
time.
updateDispatcher
private void updateDispatcher()
- after some deferred events are dispatched, this function actually
determines the next occurrence of a deferred event (and readjusts the
notification frequency for Timed) or if there are no further events
registered, the function cancels the notifications
Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.