Mojo::...nsumer(3pm)

πŸ’– Mojo::RabbitMQ::Client::Consumer β€” the whole vibe πŸ’–

okay so bestie, this is a page from the User Contributed Perl Documentation (that's the manual name, iykyk 🌸), and it's all about Mojo::RabbitMQ::Client::Consumer β€” literally a simple Mojo::RabbitMQ::Client-based consumer. no cap, that's the whole NAME section. 🫢


✨ SYNOPSIS ✨

here's the whole thing, copy-paste ready, not me changing a single character πŸ’…

use Mojo::RabbitMQ::Client::Consumer;
my $consumer = Mojo::RabbitMQ::Consumer->new(
  url      => 'amqp://guest:guest@127.0.0.1:5672/?exchange=mojo&queue=mojo',
  defaults => {
    qos      => {prefetch_count => 1},
    queue    => {durable        => 1},
    consumer => {no_ack         => 0},
  }
);

$consumer->catch(sub { die "Some error caught in Consumer" } );
$consumer->on('success' => sub { say "Consumer ready" });
$consumer->on(
  'message' => sub {
    my ($consumer, $message) = @_;

    $consumer->channel->ack($message)->deliver;
  }
);
$consumer->consume_p->wait;

Mojo::IOLoop->start unless Mojo::IOLoop->is_running;

like… look at her go 😭 the catch grabs errors, success fires when the consumer's ready, message fires per message and acks + delivers it, then consume_p->wait blocks, and finally Mojo::IOLoop->start kicks the loop off unless it's already running. main character energy fr fr πŸ‘‘


🌈 DESCRIPTION 🌈

so the DESCRIPTION section is lowkey just vibing here β€” it's empty in this page, no extra tea πŸ“ (which honestly just means the synopsis above is doing all the talking πŸ’€).


πŸ¦‹ EVENTS πŸ¦‹

Mojo::RabbitMQ::Client::Consumer inherits all events from Mojo::EventEmitter and can emit the following new ones.

(and that's it β€” the list of new ones isn't spelled out here, so don't come for me πŸ™ˆ)


πŸŽ€ ATTRIBUTES πŸŽ€

Mojo::RabbitMQ::Client::Consumer has following attributes.

(yep, that's the whole section β€” iconic in its minimalism, honestly ✨)


🌸 METHODS 🌸

Mojo::RabbitMQ::Client::Consumer inherits all methods from Mojo::EventEmitter and implements the following new ones.

(same deal β€” the list of new ones isn't written out on this page πŸ™ˆ)


πŸ‘‘ SEE ALSO πŸ‘‘

  • Mojo::RabbitMQ::Client β€” the parent, the blueprint, the blueprint-y icon πŸ’œ

Copyright (C) 2015-2017, Sebastian Podjasek and others

This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.

fr fr, it's free software β€” remix it, share it, just respect the Artistic License version 2.0 terms, periodt πŸ’…

and that's the whole page bestie!! 🌈✨

cute little sign-off so you know where this came from: 🫢 generated by perl v5.42.0, dated 2019-08-25, and it's the Mojo::...nsumer(3pm) page (the truncated name is just how the manual displays it, don't @ me 😭). slay, go build your consumer πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from