NAME

At::Protocol::Firehose - AT Protocol Firehose Client

SYNOPSIS

my $fh = $at->firehose(sub ( $header, $body, $err ) {
    return warn $err if $err;
    say "Event type: " . $header->{t};
});

$fh->start();

DESCRIPTION

At::Protocol::Firehose handles the real-time streaming of events from an AT Protocol relay or PDS. It decodes the binary DAG-CBOR messages into Perl data structures.

Each message from the firehose consists of two parts:

1. Header: A map containing the message type (t) and optional operation (op).
2. Body: The actual event data, which varies by message type.

Methods

new( at = $at, callback => $cb, [ url => $url ] )>

Constructor. url defaults to the global Bluesky relay firehose.

start()

Starts the WebSocket connection. This is non-blocking and requires an event loop (like Mojo::IOLoop) to be running.

SEE ALSO

At, https://docs.bsky.app/docs/advanced-guides/firehose

AUTHOR

Sanko Robinson <sanko@cpan.org>

LICENSE

Copyright (c) 2026 Sanko Robinson. License: Artistic License 2.0.