Skip to content

WriteEventPublishInstance

Defined in: runtime/publish.ts:5

Handles the creation of events against parent elements; in the current case either being the App or an Item.

TProperties = any

readonly prn: string

Defined in: runtime/publish.ts:6

immediate(payload): Promise<unknown>

Defined in: runtime/publish.ts:25

Operates in a similar way to publish; however, events are executed immediately and as the current Unit-Of-Work. This is useful if the results of the event execution are relatively short and the result is useful to the current execution.

Only alpyne platform listeners are executed. Subsystems and thus any “side-effects” are executed asynchronously as per the publish method.

This method currently returns “unknown” as we want to leave open the possibility of more complete event returns in the future. Do not rely on the output of this function; its completion is all the information that is provided.

TProperties

Promise<unknown>

publish below.


publish(payloadOrPayloads): Promise<void>

Defined in: runtime/publish.ts:40

Publishes this event against its parent. Either a single or multiple payload can be provided. This will result either in one or multiple individual events respectively.

Publishing is:

  • Asynchronous. This function does not “block”; the event is created and will be processed by the reactor event loop.

  • Transactional. If the current execute block fails, the event is not created. Equally, the event will not be processed until the current transaction (execute block) completes.

TProperties | TProperties[]

Promise<void>