1Mojo::RabbitMQ::Client:U:sLeorcaCloQnuteruieb(u3tpemd)PMeorjlo:D:oRcaubmbeinttMaQt:i:oCnlient::LocalQueue(3pm)
2
3
4
6 Mojo::RabbitMQ::Client::LocalQueue - Callback queue
7
9 use Mojo::RabbitMQ::Client::LocalQueue
10
11 my $queue = Mojo::RabbitMQ::Client::LocalQueue->new();
12
13 # Register callback when content appears
14 $queue->get(sub { say "got expected content: " . $_[0] });
15
16 # Push some content to consume
17 $queue->push("It Works!");
18
19 # This prints:
20 # got expected content: It Works!
21
23 Mojo::RabbitMQ::Client::LocalQueue is a queue for callbacks expecting
24 some content to be received.
25
27 Mojo::RabbitMQ::Client::LocalQueue implements following methods:
28
29 get
30 $queue->get(sub { process_message($_[0]) })
31
32 Registers a callback which is executed when new message is pushed to
33 queue.
34
35 push
36 $queue->push("Some content");
37 $queue->push({objects => 'are also welcome});
38
39 Pushes content to queue and also drains all declared callbacks.
40
42 Mojo::RabbitMQ::Client, Mojo::RabbitMQ::Client::Channel
43
45 Copyright (C) 2015-2017, Sebastian Podjasek and others
46
47 Based on AnyEvent::RabbitMQ::LocalQueue - Copyright (C) 2010 Masahito
48 Ikuta, maintained by "bobtfish@bobtfish.net"
49
50 This program is free software, you can redistribute it and/or modify it
51 under the terms of the Artistic License version 2.0.
52
53
54
55perl v5.34.0 2021-0M7o-j2o2::RabbitMQ::Client::LocalQueue(3pm)