Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt

Use this file to discover all available pages before exploring further.

When all Unreal Engine instances are busy, the SDK places users in a queue. The queue system notifies your application of the user’s position so you can display appropriate UI.
The queue system only activates when all available UE instances are busy. If an instance is free, the user connects immediately without entering the queue.

Registering the queue callback

const { queueHandler } = await StreamPixelApplication({
  appId: 'your-project-id',
  AutoConnect: true,
});

queueHandler((msg) => {
  console.log(`Position: ${msg.position}`);
  console.log(`Message: ${msg.message}`);
});

Callback data

PropertyTypeDescription
msg.positionnumberThe user’s current position in the queue
msg.messagestringStatus message from the server

Queue messages

The signaling server sends these messages:
MessageMeaning
"You are in Queue"User is waiting for an available instance
"Not Available"No worker nodes are available
"Application Not Found"The project/application does not exist
"Application Error"The UE application encountered an error

Displaying queue position

queueHandler((msg) => {
  if (msg.message === 'You are in Queue') {
    document.getElementById('queue-display').style.display = 'block';
    document.getElementById('queue-position').textContent = msg.position;
  }
});
The queue callback fires every time the server sends an update (e.g., when the user’s position changes as others connect or disconnect).

Next steps

Reconnection

Handle WebSocket drops with automatic reconnection.

Connection lifecycle

Map the events fired during initial connection.