[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.1 Setting Up Async Event Handlers

Asynchronous handlers are configured through the ^$JOB SSV. In order to become proficient in writing asynchronous event handling code, you need to be aware of several important concepts:

Event Classes

Event classes denote particular categories of events. These include COMM, HALT, IPC, INTERRUPT, POWER, TIMER, and USER event classes. At present, only INTERRUPT events are supported.

Event Identifiers

Event identifiers denote the precise nature of the event that has occurred. For instance, resizing the terminal window in which a FreeM job is running will send an event of class INTERRUPT with an event identifier of SIGWINCH (short for SIGnal WINdow CHange).

Event Handlers

Event handlers are M routines or subroutines that can be registered to run when an event of a certain event class occurs.

Event Registration

Event registration is the process of modifying the ^$JOB SSV to associate a particular event class and event identifier with an event handler routine or subroutine.

Event Block

Event blocking is the means by which asynchronous event handling can be temporarily suspended. For example, asynchronous events are temporarily and implicitly blocked for the duration of event handler execution, unless explicitly un-blocked within the event handler. Event handling can also be blocked and unblocked programatically from M code using the ABLOCK and AUNBLOCK commands.

The following sections of this chapter will take you step-by-step through setting up an event handler for SIGWINCH signal handling.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by root on October 14, 2020 using texi2html 1.82.