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.
Type Parameters
Section titled “Type Parameters”TProperties
Section titled “TProperties”TProperties = any
Properties
Section titled “Properties”
readonlyprn:string
Defined in: runtime/publish.ts:6
Methods
Section titled “Methods”immediate()
Section titled “immediate()”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.
Parameters
Section titled “Parameters”payload
Section titled “payload”TProperties
Returns
Section titled “Returns”Promise<unknown>
publish below.
publish()
Section titled “publish()”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.
Parameters
Section titled “Parameters”payloadOrPayloads
Section titled “payloadOrPayloads”TProperties | TProperties[]
Returns
Section titled “Returns”Promise<void>