[#BloombergLP-bdlmt-TimerEventScheduler-scheduleEvent] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/TimerEventScheduler.adoc[TimerEventScheduler]::scheduleEvent :relfileprefix: ../../../ :mrdocs: Schedule the specified callback to run at the specified time. == Synopsis Declared in `<bdlmt_timereventscheduler.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlmt/TimerEventScheduler/Handle.adoc[Handle] scheduleEvent( xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& time, xref:bsl/function-0a.adoc[bsl::function<void()>] const& callback, xref:BloombergLP/bdlmt/TimerEventScheduler/EventKey.adoc[EventKey] const& key = EventKey(0)); ---- == Description Schedule the specified `callback` to be dispatched at the specified `time`. On success, return a handle that can be used to cancel the `callback` (by invoking `cancelEvent`), or return `e_INVALID_HANDLE` if scheduling this event would exceed the maximum number of scheduled events for this object (see constructor). Optionally specify `key` to uniquely identify the event. The `time` is an absolute time represented as an interval from some epoch, which is detemined by the clock indicated at construction (see []Clock‐Types)). == Return Value a handle for the event, or `e_INVALID_HANDLE` if the limit is exceeded == Parameters [cols="1,4"] |=== | Name| Description | *time* | absolute time at which to dispatch the callback | *callback* | function to invoke at `time` | *key* | optional key uniquely identifying the event |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#