Reference

Cheat Sheet, Types & API Tables

The quick-lookup page: server/client differences, exported types, testing, common errors, and every function in one place.

Server vs. Client Cheat Sheet

The single most important thing to internalize: the server and every client each run their own separate instance of Thread's internal state (Thread._Register, its own start Promise, etc.) — they are different Lua VMs entirely. Nothing about a service you create on the server is automatically visible to Thread.GetService on the client, or vice versa. Channel is the only bridge between the two.

I want to...On the serverOn the client
Define a service/controllerThread.CreateService({...})Thread.CreateService({...}) (same call, informally called a "controller")
Expose something to clientsGive the service a Client = {...} table— (nothing to expose from one client to others)
Get one of MY OWN registered servicesThread.GetService("X")Thread.GetService("X")
Get a server service's Client API— (already has direct access)Channel.BuildClient("X") — never Thread.GetService
Fire a signalself.Client.MySignal:Fire(player, ...) / :FireAll(...) / :FireExcept(p, ...)proxy.MySignal:Fire(...) (server inferred)
Read/set a property:Get() / :Set(v) / :SetFor(p, v) / :GetFor(p) / :ClearFor(p):Get() / :Observe(fn) only
A common mistake
[Thread] No service named 'ArrestService' is registered

This means you called Thread.GetService("ArrestService") on the client, but ArrestService was only ever created on the server. Use Channel.BuildClient("ArrestService") instead.

Exported Luau Types

Every module is written under --!strict and exports its own types, so if your own code also uses --!strict (or just wants editor autocomplete), you can reference them directly off the required module:

local Thread = require(game:GetService("ReplicatedStorage").Packages.Thread)

local def: Thread.ServiceDef = {
    Name = "MoneyService",
    Client = { ... },
}

local MoneyService = Thread.CreateService(def)
TypeFromShape
Thread.ServiceDef / Thread.ServiceThreadClient entries, dependencies, middleware, remote policies, limits, and all three lifecycle hooks.
Thread.RegisterResultThread{ Module: ModuleScript, Success: boolean, Result: any, Error: any }
Thread.MiddlewareThread (re-exported from Channel){ Inbound: MiddlewareList?, Outbound: MiddlewareList? }
Channel.MiddlewareFnChannel(player: Player, args: {any}) -> boolean
Channel.WrapOptionsChannelMiddleware, remote policies, rate limits, payload limits, and deferred readiness.
Channel.RemotePolicy / Channel.RemoteErrorChannelPer-remote validation rules and structured Method failures.
Promise.Promise<T>PromiseThe Promise type itself.
Signal.Signal / Signal.ConnectionUtil/SignalThe Util Signal's own types.
Trove.Trackable / Trove.SignalLikeUtil/TroveWhat kinds of values Trove:Add/:Connect accept.
Option.Option<T> / Option.MatchTable<T>Util/OptionThe Option type and the shape :Match({...}) expects.
EnumList.EnumList / EnumList.EnumItemUtil/EnumListThe EnumList type and the shape of one of its items.

Testing

A tiny, dependency-free test runner lives under Tests/ (no TestEZ, no Wally — just pcall + assert).

  1. Put the contents of src/ under ReplicatedStorage/Packages and put Tests/ under ServerScriptService/Tests.
  2. Start a Play/Test session in Studio, then paste into the Command Bar:
    require(game.ServerScriptService.Tests["Thread.spec"])
  3. Read the Output window — [PASS]/[FAIL] per test case, with a summary line at the end.

Troubleshooting

No service named 'X' is registered

You're calling Thread.GetService for a service that isn't registered on that side. If X is a server-only service and you're on the client, use Channel.BuildClient("X") instead.

Remote/service marker timeout errors

'<Name>' does not exist after waiting <N>s / Service '<Name>' never became ready means the service name is misspelled, the service has no Client table, or that service failed during server startup. Channel.BuildClient already waits for server readiness.

A critical service's failure didn't crash my script

That's the default, intentional behavior. Handle it via Thread.Start():catch(...), or opt back into the old behavior with Thread.Configure({ HaltOnCriticalFailure = true }).

Rate limit warnings in the output

A player is calling a Method/Signal faster than the configured limit — either legitimate rapid input (raise the limit via RateLimit/InvokeRateLimit) or exploit/spam attempts (leave it, that's the protection working).

Duplicate service name error

Two different ModuleScripts called Thread.CreateService({ Name = "X" }) with the same name — names must be unique per side.

Full API Reference — Thread

FunctionDescription
Thread.CreateService(def)Registers a service, lifecycle hooks, networking rules, and dependencies.
Thread.GetService(name)Returns a registered service (this side's registry) or errors.
Thread.GetServices()Returns a copy of the full service registry.
Thread.Unregister(name)Removes a service before Start().
Thread.Register(folder, recursive?)Requires every ModuleScript under folder; returns a results report.
Thread.Start()Binds Client remotes, runs ThreadInit then ThreadStart in dependency order. Returns the start Promise.
Thread.OnStart()Returns an independent observer Promise for startup, safe to call any time.
Thread.Stop() / Thread.OnStop()Stops services in reverse dependency order and destroys networking state.
Thread.GetServiceStatus(name)Returns the service's current lifecycle state.
Thread.Configure({ Debug, HaltOnCriticalFailure })Central configuration.
Thread.CreateSignal() / Thread.CreateUnreliableSignal() / Thread.CreateProperty(v)Markers for use inside a service's Client table.
Thread.VersionCurrent version string.
Thread.ChannelDirect access to the Channel module.
Thread.Signal / .Trove / .TableUtil / .Option / .EnumList / .MathUtil / .TimerUtilDirect access to the Util modules.

Full API Reference — Channel

FunctionDescription
Channel.WrapService(name, clientTable, opts?)Server-only. Binds a Client table to real Remotes. Called automatically by Thread.Start().
Channel.BuildClient(name, timeout?)Client-only. Returns a proxy for a wrapped service.
Channel.GetServiceManifest(name)Returns a copy of the exact Remote manifest.
Channel.DecodeResponse(value) / Channel.IsRemoteError(value)Decodes service Method responses and identifies structured errors.
Channel.Destroy(name)Removes every Remote created for a service.
Channel.On/FireClient/FireAll/FireServer/SetFunction/InvokeServer/InvokeClient/Event/FunctionLow-level, string-keyed API.
Channel.Configure({...})Bulk-set Channel.Debug, Channel.DefaultRateLimit, etc.

Full API Reference — Property

MethodWhereDescription
:Get()bothClient: last received value. Server: the shared default.
:Set(value)serverSets the default and broadcasts to every client without an override.
:SetFor(player, value)serverSets a value visible only to player.
:GetFor(player)serverReads player's override, or the default if none.
:ClearFor(player)serverRemoves player's override.
:Observe(fn)clientCalls fn immediately and on every change; returns a {Disconnect} handle.
:Destroy()serverDisconnects the internal PlayerRemoving connection.

Full API Reference — Signal (Client-table version)

MethodWhereDescription
:Fire(...)bothServer: :Fire(player, ...) to one client. Client: :Fire(...) to the server.
:FireAll(...)serverTo every client.
:FireExcept(player, ...)serverTo every client except player.
:Connect(fn)bothServer handler gets (player, ...); client handler gets (...).
:Destroy()bothDisconnects/destroys the underlying Remote.

This is a different Signal class from the standalone Util/Signal.luau — same name, but one is Remote-backed (this one) and the other is pure in-process pub/sub. See the Util Modules page for that one.

See Promise and Util Modules for their complete references, and the CHANGELOG for version history.