ExtensionAsyncRequest

Sends a command to the server-side Extension attached to the Zone or to a Room (alternative version).


This is an alternative version of ExtensionRequest that can be run asynchronously on the server side. While all requests are processed and executed sequentially, in the order they're sent to the server, there can be a few situations where running requests in parallel could be useful.

For instance, if you're sending fast updates to the server in a real-time game and you need to send an occasional request that talks to a database or other slow-responding services, you may disrupt the timing of the updates. To avoid this, use this request. On the server side it will run on a separate virtual thread without blocking the subsequent requests.

Constructor

new ExtensionAsyncRequest(extCmd, parametersopt, roomopt)

Creates a new instance of the ExtensionAsyncRequest class.
Pass the instance to the SmartFox#send method to validate and execute the request.
Parameters:
NameTypeAttributesDefaultDescription
extCmdstringThe name of the command which identifies an action that should be executed by the server-side Extension.
parametersSFSObject<optional>
nullAn object containing custom data to be sent to the Extension; can be null if no data is needed.
roomSFSRoom<optional>
nullIf null, the specified command is sent to the server-side Extension attached to the currently joined Zone; if not null, the command is sent to the server-side Extension attached to the passed Room.