Type Definitions
-
onComplete(message)
-
A publish operation has completed successfully.
Parameters:
Name Type Description message
eFTLMessage This message has been published. -
onConnect(connection)
-
A new connection to the eFTL server is ready to use.
Parameters:
Name Type Description connection
eFTLConnection The connection that is ready to use. - See:
-
onDisconnect(connection, errorCode, reason)
-
A connection to the eFTL server has closed.
Parameters:
Name Type Description connection
eFTLConnection The connection that closed. errorCode
object A code categorizes the error. Your program can use this value in its response logic. reason
string This string provides more detail. Your program can use this value in error reporting and logging. - See:
-
onError(obj, errorCode, reason)
-
An error prevented an operation.
Parameters:
Name Type Description obj
eFTLConnection | eFTLMessage | object The source of the error. For connection errors, this argument is a connection object. For publish errors, this argument is the message that was not published. For subscription errors, this argument is an object that represents a subscription identifier. errorCode
object A code categorizes the error. Your program can use this value in its response logic. reason
string This string provides more detail. Your program can use this value in error reporting and logging. -
onMessage(message)
-
Process an inbound message.
The eFTL library presents inbound messages to this callback for processing. You must implement this callback to process messages.
Parameters:
Name Type Description message
eFTLMessage The inbound message. -
onReconnect(connection)
-
A connection to the eFTL server has re-opened and is ready to use.
The eFTL library invokes this method only after your program calls eFTLConnection#reconnect (and not eFTLConnection#connect).
Parameters:
Name Type Description connection
eFTLConnection The connection that reconnected. -
onReply(reply)
-
A request operation has received a reply.
Parameters:
Name Type Description reply
eFTLMessage The reply message. -
onStateChange(connection, state)
-
The connection state has changed.
The eFTL library invokes this method whenever the connection state changes.
Parameters:
Name Type Description connection
eFTLConnection The connection whose state has changed. state
number The connection has changed to this state. - See:
-
onSubscribe(subscriptionId)
-
A new subscription is ready to receive messages.
The eFTL library may invoke this method after the first message arrives.
To close the subscription, call eFTLConnection#unsubscribe or eFTLConnection#closeSubscription with the subscription identifier.
Parameters:
Name Type Description subscriptionId
object The subscription identifier.