Delay

Description

An opaque awaitable type, specifically used in coroutines, representing an event owned by a specific object, that can be 'awaited', or listened to.

Event e = current.event(“OnEntry”);
await e;
await e; // awaiting the same Event object a second time will await the event a second time. 
// The listening is initiated when the await statement executes, not when 
// the event object is created. In other words, an instance of an Event object is
// a reference to an object’s event that may fire multiple times, not a single 
// execution of an object’s event.

await current.event(“OnExit”);
await Event.evaluation(current.labels[“MyCode”]);
Event evaluationEvent = Event.evaluation(current.labels[“MyCode”]);
while (true) {
	await evaluationEvent;
	…
}

An event represents a generic reference to a specific object's OnEntry, OnExit, etc., event. It is not a reference to a single execution of an object's event. This means you can await the same Event multiple times, and each await may be resumed on different executions of the object's event. In other words, the listening mechanism is initiated when the await statement executes, not when the Event object is created.

Methods

Event Constructs an Event base on the given parameters

Static Methods

evaluation Returns an Event object representing the evaluation of a node in the tree.

Details

Do no remove, this fixes the anchor on doc.flexsim.com

Delay.Event()

Event Event( treenode owner , string eventName , Variant req1 = nullvar , Variant req2 = nullvar , Variant req3 = nullvar )

Parameters

owner The object that owns the event.
eventName The name of the event.
req1 ... req3 The event's resolution requirements. These dependent on which event you are targeting. Some events require some additional information in order to resolve the event reference.

Returns

Event The resulting Event.

Description

Constructs an Event base on the given parameters

await Event(current, "OnEntry");
Do no remove, this fixes the anchor on doc.flexsim.com

Delay.evaluation()

static Event evaluation( treenode node )

Parameters

node The node whose evaluation you want to listen for.

Returns

Event The resulting Event.

Description

Returns an Event object representing the evaluation of a node in the tree.

await Event.evaluation(current.labels["MyCode"];