Skip to content

Commit c3af97b

Browse files
committed
Add rebar3 aliases for RabbitMQ tutorial commands
1 parent 597058d commit c3af97b

File tree

2 files changed

+41
-12
lines changed

2 files changed

+41
-12
lines changed

erlang/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,30 @@ You need Erlang Client binaries:
2525

2626
[Tutorial one: "Hello World!"](https://www.rabbitmq.com/tutorials/tutorial-one-python.html):
2727

28-
rebar3 shell --eval 'send:start(), init:stop().'
29-
rebar3 shell --eval 'recv:start(), init:stop().'
28+
rebar3 send
29+
rebar3 recv
3030

3131
[Tutorial two: Work Queues](https://www.rabbitmq.com/tutorials/tutorial-two-python.html):
3232

33-
rebar3 shell --eval 'new_task:start(["A very hard task which takes two seconds"]), init:stop().'
34-
rebar3 shell --eval 'worker:start(), init:stop().'
33+
rebar3 new_task
34+
rebar3 worker
3535

3636
[Tutorial three: Publish/Subscribe](https://www.rabbitmq.com/tutorials/tutorial-three-python.html):
3737

38-
rebar3 shell --eval 'receive_logs:start(), init:stop().'
39-
rebar3 shell --eval 'emit_log:start(["Info: This is the log message"]), init:stop().'
38+
rebar3 receive_logs
39+
rebar3 emit_log
4040

4141
[Tutorial four: Routing](https://www.rabbitmq.com/tutorials/tutorial-four-python.html):
4242

43-
rebar3 shell --eval 'receive_logs_direct:start(["info"]), init:stop().'
44-
rebar3 shell --eval 'emit_log_direct:start(["info", "Hello"]), init:stop().'
43+
rebar3 receive_logs_direct
44+
rebar3 emit_log_direct
4545

4646
[Tutorial five: Topics](https://www.rabbitmq.com/tutorials/tutorial-five-python.html):
4747

48-
rebar3 shell --eval 'receive_logs_topic:start(["*.rabbit"]), init:stop().'
49-
rebar3 shell --eval 'emit_log_topic:start(["red.rabbit", "Hello"]), init:stop().'
48+
rebar3 receive_logs_topic
49+
rebar3 emit_log_topic
5050

5151
[Tutorial Six: RPC](https://www.rabbitmq.com/tutorials/tutorial-six-python.html):
5252

53-
rebar3 shell --eval 'rpc_server:start(), init:stop().'
54-
rebar3 shell --eval 'rpc_client:start(["10"]), init:stop().'
53+
rebar3 rpc_server
54+
rebar3 rpc_client

erlang/rebar.config

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,33 @@
22
{deps, [
33
{amqp_client, "3.12.2"},
44
{uuid, {git, "https://github.com/okeuday/uuid.git", {tag, "v2.0.7"}}}
5+
]}.
6+
7+
{plugins, [rebar_alias]}.
8+
9+
{alias, [
10+
{send, [compile, {shell,
11+
"--eval 'send:start(), init:stop().'"}]},
12+
{recv, [compile, {shell,
13+
"--eval 'recv:start(), init:stop().'"}]},
14+
{new_task, [compile, {shell,
15+
"--eval 'new_task:start([\"A very hard task which takes two seconds\"]), init:stop().'"}]},
16+
{worker, [compile, {shell,
17+
"--eval 'worker:start(), init:stop().'"}]},
18+
{receive_logs, [compile,
19+
{shell, "--eval 'receive_logs:start(), init:stop().'"}]},
20+
{emit_log, [compile, {shell,
21+
"--eval 'emit_log:start([\"Info: This is the log message\"]), init:stop().'"}]},
22+
{receive_logs_direct, [compile, {shell,
23+
"--eval 'receive_logs_direct:start([\"Info\"]), init:stop().'"}]},
24+
{emit_log_direct, [compile, {shell,
25+
"--eval 'emit_log_direct:start([\"Info\", \"Hello\"]), init:stop().'"}]},
26+
{receive_logs_topic, [compile, {shell,
27+
"--eval 'receive_logs_topic:start([\"*.rabbit\"]), init:stop().'"}]},
28+
{emit_log_topic, [compile, {shell,
29+
"--eval 'emit_log_topic:start([\"red.rabbit\", \"Hello\"]), init:stop().'"}]},
30+
{rpc_server, [compile, {shell,
31+
"--eval 'rpc_server:start(), init:stop().'"}]},
32+
{rpc_client, [compile, {shell,
33+
"--eval 'rpc_client:start([\"10\"]), init:stop().'"}]}
534
]}.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy