Parallelizer
Contains constructor methods to instantiate classes
Properties
DataType
{[DataType]: {DataType | string}}
Contains all the supported DataTypes for packet definitions
Functions
ListenToTask
Creates 3 new message binds to the actor, one will caches the packet type definitions, the other will cache the local memory, this will not be bound if cacheLocalMemory
is false
. The last one will process the actual task, which has a middleware that will serialize the return values of the callback and batch them accordingly.
Parameters
-
actor:
Actor
-
taskName:
string
-
callback:
(taskId: number, memory: SharedTable?, ...Types.SharedTableValues) -> {Types.SerializableValues}
- cacheLocalMemory:
boolean
Returns
void
CreateTaskCoordinator
Create a new population of actors. The number of actors should ideally be a power of 2, refer to Multithreading Best Practices to determine the right number of actors.
Parameters
- workerScript:
Script | LocalScript
- actorStorage:
Instance
- actorCount:
number
Returns