-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
161 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Rembus | ||
using UUIDs | ||
|
||
consume(topic, value) = @info "$topic = $value" | ||
|
||
url = isempty(ARGS) ? string(uuid4()) : ARGS[1] | ||
rb = component(url) | ||
subscribe(rb, "a/*/c", consume, true) | ||
|
||
forever(rb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
include("../utils.jl") | ||
|
||
my_topic(ctx) = @info "my_topic called" | ||
my_service(ctx, x, y) = x + y | ||
|
||
function run() | ||
ctx = "mystring" | ||
|
||
rb = component("abc") | ||
|
||
shared(rb, ctx) | ||
subscribe(rb, my_topic, true) | ||
subscribe(rb, "topic", my_topic, true) | ||
expose(rb, "service", my_service) | ||
expose(rb, my_service) | ||
reactive(rb) | ||
|
||
client = connect() | ||
publish(client, "topic") | ||
res = rpc(client, "service", [1, 2]) | ||
@test res == 3 | ||
|
||
unsubscribe(rb, "topic") | ||
unexpose(rb, "service") | ||
unreactive(rb) | ||
|
||
@test_throws RpcMethodUnavailable rpc(client, "service", [1, 2]) | ||
|
||
# just for lines coverage | ||
@async forever(rb) | ||
|
||
publish(rb, "devnull") | ||
res = rpc(rb, "version") | ||
@test isa(res, String) | ||
|
||
close(client) | ||
terminate(rb) | ||
end | ||
|
||
execute(run, "test_supervised_api") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters