Skip to main content
Skip table of contents

Asynchronous actions and PostScript device plugins

This page applies to Harlequin v13.1r0 and later; and to Harlequin MultiRIP but not Harlequin Core


It is possible to request the RIP to execute a PostScript language procedure asynchronously with the normal processing of a job, or to cause a PostScript language interrupt or timeout. With the new thread RIP architecture, it is no longer possible to temporarily halt the RIP and give all the processing time to the PostScript language device.

An asynchronous PostScript language procedure is requested by sending an event, for more information see SWMSG__ASYNC__PS message and event. The "asynchronous PostScript language action" message specifies the number of the PostScript language procedure in the serviceinterrupt dictionary, defined in execdict, to be run. For example:

TEXT
    {
      SWMSG_ASYNC_PS async_ps;
      ...
      async_ps.id = ps_action;
      (void)SwEvent(SWEVT_ASYNC_PS, &async_ps, sizeof(async_ps));
      ...
    }

Where ps_action is the number of the PostScript language procedure to execute, which must have been defined in the serviceinterrupt dictionary. The number must be in the range 0 to 31. Requests to run an asynchronous PostScript language action with an id greater than 31 will be ignored.

The procedure numbers 2 and 31 are normally reserved in HMR for its own use and should not be used by OEM code. (Action 31 will quit the RIP, but you wouldn't want to do that from a plugin.)

The return value from the call to SwEvent() can be ignored since it will be acted upon in a normal system. This is also true for all the sample code in this section.

Asynchronous PostScript language actions are run in the order they are requested. Multiple requests to run an asynchronous action that occur before it can be run are treated as a single request. The asynchronous action will not be run multiple times.

The entries in the serviceinterrupt dictionary are defined by a startup file; for example, this file is HqnProduct in HMR. For variants of the core RIP, there is no predefined content for the serviceinterrupt dictionary, other than defining 31 to quit the RIP; the values (procedure actions) are highly dependent on the skin and best determined by the OEM.

An interrupt event is available that takes a timeline reference. In order to interrupt a specific job, the timeline reference must be set to the job's SWTLT_JOB_STREAM timeline reference or any descendant thereof. Alternatively, all jobs can be interrupted by setting the timeline reference to 0 .

For example, to interrupt all jobs:

TEXT
    SWMSG_INTERRUPT msg;
    msg.timeline = 0;
    (void)SwEvent(SWEVT_INTERRUPT_USER, &msg, sizeof(msg));


A timeout is effected with very similar code:

TEXT
    {
      SWMSG_INTERRUPT timeout;
      ...
      timeout.timeline = job_tl_ref;
      (void)SwEvent(SWEVT_INTERRUPT_TIMEOUT, &timeout, sizeof(timeout));
      ...
    }


Note: You cannot pass a zero-timeline reference with SWEVT_INTERRUPT_TIMEOUT . (It will be ignored.)

While interrupts are now signaled using events, OEM code should not register event handlers to detect when an interrupt has been signaled and abort their PSDEV processing. The Harlequin MultiRIP does not always immediately process an interrupt and requires PostScript devices to continue working normally until it handles the interrupt.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.