Mojo::RabbitMQ::Client::LocalQueue3pm
Callback queue
Usage
use Mojo::RabbitMQ::Client::LocalQueuemy $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.
Copyright and license
Copyright (C) 2015-2017, Sebastian Podjasek and others
Based on AnyEvent::RabbitMQ::LocalQueue - Copyright (C) 2010 Masahito Ikuta, maintained by "[email protected]"
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
Releases
4 releases since Debian 10 (Buster); the text changed 2 times.