Volt

get_comm_channel

Retrieves an existing communication channel by its identifier.

Syntax

get_comm_channel(id: string) -> Channel

Parameters

ParameterTypeDescription
idstringThe channel identifier

Returns

TypeDescription
ChannelThe channel object

Description

get_comm_channel retrieves a communication channel that was created with create_comm_channel. This is typically used inside an actor to get a reference to a channel created on the main thread.

Example

-- On main thread
local id, channel = create_comm_channel()
channel.Event:Connect(print)

-- Inside actor (via run_on_actor)
run_on_actor(actor, [[
    local channelId = ...
    local channel = get_comm_channel(channelId)
    channel:Fire("Hello from actor!")
]], id)

Notes

  • The channel ID is passed from the main thread to the actor
  • Use this inside actors to communicate back to the main thread

On this page