Skip to content

Promise wrap for RemoteFunctions originating from the server.

Notifications You must be signed in to change notification settings

CMorrison82z/ServerRequests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server Requests

Server requests are essentially RemoteFunctions wrapped in a Promise with some basic management options.

API

Promises Cancelled on the server are automatically communicated to the client. This means that if a handler was set to handle OnCancel as specified by Promise.new, the client will be able to reconcile cancelled requests with ease.

Server :

InvokeClient(player : Player, requestName : string, timeout : number?, ...) -> Promise, UUID

Invokes the client, returning a Promise.

GetPlayerActiveRequests(player : Player) -> {{[string] : {[number] : Promise}}}

Retrieve a dictionary of active requests for the player. The dictionary has keys of RequestName. The entries for an active request of a specified request name is a dictionary of UUID's with the associated Promise.

Client :

SetRequestHandler(requestName, handler : (any) -> any)

Set the handler for requests of "requestName".

SetRequestHandlerPromise(requestName, handler : ((any) -> Promise)?)

Set the handler for requests of "requestName". This must return a Promise. Used for handlers that need control over what should happen if the Server cancels a request.

GetRequestHandler(requestName)

Gets the function set as the request handler for "requestName"

About

Promise wrap for RemoteFunctions originating from the server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages