Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Elitriare/ByteNet-Max/llms.txt
Use this file to discover all available pages before exploring further.
defineQuery defines a request/response network channel — the ByteNet Max equivalent of a Roblox RemoteFunction. The client calls invoke with a typed request payload; the server’s listen callback receives it, processes it, and returns a typed response. The client thread yields until the response arrives, making it synchronous from the caller’s perspective while remaining non-blocking for other threads.
Signature
Parameters
A configuration table describing the query’s request and response shapes.
Return value
AQueryDef object. The methods available depend on the run context.
Client-only methods
Sends
request to the server and yields the calling thread until the server’s listener callback returns. The return value is the typed response. If no server listener is registered, the client will yield indefinitely.Shared methods
Registers a callback that fires when a request arrives. The callback must return a value matching the
response data type — ByteNet Max serializes and sends it back to the invoking client automatically. Returns a disconnect function.The callback signature is (request: Req, player: Player?) -> Res. On the server, player is the requesting client. On the client, player is nil.Same as
listen, but the callback fires only once before automatically disconnecting. Returns a disconnect function if you need to cancel it before it fires.Removes every listener registered on this query. After calling this, any in-flight
invoke calls will yield indefinitely — disconnect all listeners only when you are certain no clients are waiting for a response.Yields the current thread until the next request arrives, then returns the request data and the requesting player. Internally uses a one-shot listener.
Example
Disconnecting a query listener
Assign the return value oflisten to a variable to disconnect it later.
invoke yields the calling client thread until the server returns a response. From the caller’s perspective it is synchronous — execution resumes on the next line with the response value. Other threads in the same LocalScript continue running normally while the invoking thread waits.Incoming query requests pass through the same server-side rate limiter as packets. Each client is allowed up to 8,192 bytes per second by default. Requests that exceed this budget are dropped and a warning is printed. The limit can be configured via the
MAX_BUFFER_SIZE attribute on the ByteNet Max module instance.