Mojo::RabbitMQ::Client::LocalQueue(3pm)

Mojo::RabbitMQ::Client::LocalQueue3pm

Callback queue

Usage

  use Mojo::RabbitMQ::Client::LocalQueue
  my $queue = Mojo::RabbitMQ::Client::LocalQueue->new();
  # Register callback when content appears
  $queue->get(sub { say "got expected content: " . $_[0] });
  # Push some content to consume
  $queue->push("It Works!");
  # This prints:
  # got expected content: It Works!

Overview

Mojo::RabbitMQ::Client::LocalQueue is a queue for callbacks expecting some content to be received.

Methods

Mojo::RabbitMQ::Client::LocalQueue implements following methods:

get

  $queue->get(sub { process_message($_[0]) })

Registers a callback which is executed when new message is pushed to queue.

push

  $queue->push("Some content");
  $queue->push({objects => 'are also welcome});

Pushes content to queue and also drains all declared callbacks.

Releases

4 releases since Debian 10 (Buster); the text changed 2 times.

  1. 10
  2. 11
  3. 12–13

From libmojo-rabbitmq-client-perl 0.3.1-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.