The GlideEventManager API provides methods to process events.

For information on creating an event queue, see Creating custom queues to process events.

GlideEventManager - GlideEventManager(String queueName)

Instantiates a GlideEventManager object.

Table 1. Parameters
Name Type Description
queueName String Name of a queue for an event listed in the Event Registry [sysevent_register] table. If no queue is provided, GlideEventManager processes against the default queue.

Example

The following example shows how to instantiate a GlideEventManager object.

var eventMgr = new GlideEventManager('my_queue');

GlideEventManager - process(Number limit)

Processes the eligible events in a queue.

You can use the limit parameter to identify a range of process_on times for events in the queue and it isn’t a hard limit. For example, if the limit is 10, the system looks for the 10 oldest pending process_on times. If multiple events have the same process_on time, more than 10 events might be claimed (that is, ready to process).

Table 2. Parameters
Name Type Description
limit Number Optional. Limits the number of events claimed. If this value isn’t passed, no limit is applied.
Table 3. Returns
Type Description
None

Example

The following example shows how to limit the number of events processed to roughly 200.

GlideEventManager('my_event_queue').process(200);