Scheduling queue

An event can be delivered either on scheduled or direct dispatch mode. On the scheduling mode, an event is once stored on the priority queue and delivered later (or even immediately) to the destination, Whereas on the direct disatch mode, an event is passed to the destination without any queue.

For a scheduled delivery, a queue must exist, of course. Usually, a client can create its own queue by snd_seq_alloc_queue function. Alternatively, a queue may be shared among several clients. See Sequencer queue accesses section for more details. For scheduling an event on the specified queue, a client needs to fill queue field with the preferred queue id.

Meanwhile, for dispatching an event directly, use use SND_SEQ_QUEUE_DIRECT as queue id.

Note that scheduling at the current time (or earlier) is different from the direct dispatch mode. On the former scheme, an event is once stored on priority queue, then delivered actually. Thus, it acquires a space from memory pool. On the other hand, the latter is passed without using memory pool. Although the direct dispatched event needs less memory, it means also that the event cannot be resent if the destination is unable to receive it momentarily.