BoxAnnounceAsync

Announce a BoxLang event to the global system interceptor service asynchronously.

By default, the event is announced to the global interception service. The return value is a BoxLang CompletableFuture that will be completed when the event has been announced. Available pools are "global" and "request". The request pool is tied to the application listener and is only available during the request lifecycle.

Example:

 // Announce globally
 var future = announceAsync( "onRequestStart", { request = request } )

 // Announce to the application request
 var future = announceAsync( "myRequestEvent", { data : myData }, "request" )
 

Method Signature

BoxAnnounceAsync(state=[string], data=[struct], poolname=[string])

Arguments

Argument
Type
Required
Description
Default

state

string

true

The interceptor event to announce: Ex: "onRequestStart", "onRequestEnd", "onError"

data

struct

false

The data struct to send with the event

{}

poolname

string

false

The name of the interceptor pool to announce the event to. Default is "global". Available pools are "global" and "request".

global

Examples

Last updated

Was this helpful?