At

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

         "xt",
         "inc",
         "share",
         "eg",
         "examples",
         "author"
      ]
   },
   "optional_features" : {
      "websockets" : {
         "description" : "Websocket based streaming services",
         "prereqs" : {
            "runtime" : {
               "requires" : {
                  "Codec::CBOR" : "0",
                  "Mojo::UserAgent" : "0"
               }
            }
         }
      }
   },

META.yml  view on Meta::CPAN

  directory:
    - t
    - xt
    - inc
    - share
    - eg
    - examples
    - author
optional_features:
  websockets:
    description: 'Websocket based streaming services'
    requires:
      Codec::CBOR: '0'
      Mojo::UserAgent: '0'
provides:
  At:
    file: lib/At.pm
    version: '1.6'
  At::Error:
    file: lib/At/Error.pm
    version: '1.1'

lib/At/Protocol/Firehose.pm  view on Meta::CPAN


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

    $fh->start();

=head1 DESCRIPTION

C<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 using L<Codec::CBOR>.

Each message from the firehose consists of two parts:

=over

=item 1. B<Header>: A map containing the message type (C<t>) and optional operation (C<op>).

=item 2. B<Body>: The actual event data, which varies by message type.



( run in 0.378 second using v1.01-cache-2.11-cpan-39bf76dae61 )