WeaverServer
The server backend of Weaver.
All of the logic here is for starting and handling services alongside the communication bridge with the client.
Types
WeaverMethod
WeaverExposed
The type that the Client table in WeaverService uses.
WeaverService
interface WeaverService {Name: string--
The name of the service.
Client: WeaverExposed[any]: anyAttributeChanged: RBXScriptSignal}The type used for all services on the server.
WeaverMiddlewareCallback
WeaverMiddleware
Middleware used by the server.
Properties
Util
This item is read only and cannot be modified. Read OnlyA module that contains all of the utility modules that Weaver exposes.
Functions
Start
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsStarts Weaver.
If any middleware is provided, it will be used as as the default if no services provide their own.
caution
This will throw an error if Weaver has already started.
OnStart
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsWeaverServer.OnStart() → ()Yields until Weaver has started. Useful for external modules that are not ran as services.
If Weaver has already started, this will not yield.
GetService
If the Name is used for a service, returns the WeaverService from the server.
caution
This will throw an error if Weaver has not started, or if Name is not used for a service.
GetServices
Returns all WeaverServices added.
caution
This will throw an error if Weaver has not started.
CreateService
WeaverServer.CreateService(Service: {Attributes: {[string]: any}?,Client: {[string]: any}?,Name: string,[any]: any,}) → WeaverMockServiceCreates and adds a WeaverService before Weaver has started.
caution
This will throw an error if Weaver has started.
AddServices
Adds all services from Handle to Weaver automatically.
Returns an array of all of the added WeaverServices.
CreateRemoteSignal
WeaverServer.CreateRemoteSignal() → MarkerCreates a remote signal marker which is turned into a RemoteSignal when Weaver is started.
caution
This will only create a RemoteSignal if it is indexxed into the Client table.
CreateUnreliableSignal
WeaverServer.CreateUnreliableSignal() → MarkerCreates an unreliable signal marker which is turned into a RemoteSignal when Weaver is started. This is adjacent to Roblox's UnreliableRemoteEvent
caution
This will only create a RemoteSignal if it is indexxed into the Client table.
CreateEmptyProperty
WeaverServer.CreateEmptyProperty() → MarkerCreates a RemoteProperty with a value of nil when Weaver has started. If you would like to create a RemoteProperty with a value, set your property in your Client table to any value, i.e Service.Client.Property = 0
caution
This will only create a RemoteProperty if it is indexxed into the Client table.