Arcana::Actor
OTP-inspired actor base class.
Subclass and implement handle to process incoming envelopes.
Actors register in the Directory, listen on the Bus, and follow
the Protocol handshake automatically.
class MyAgent < Arcana::Actor def init # setup state end
def handle(envelope : Arcana::Envelope)
data = extract_data(envelope.payload)
reply(envelope, Protocol.result(JSON::Any.new("done")))
end
end
agent = MyAgent.new(bus, dir, "my-agent", "My Agent", "Does things") agent.start
Constructors
Instance methods
address
SourceCalled when handle raises. Default: re-raise (let it crash).
Override to swallow errors and keep processing.
running?
Source