Skip to content

Commit

Permalink
Upgrade version.
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetahe committed Feb 1, 2024
1 parent dbae599 commit d99f036
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* [Using priority option](#using-priority-option)
* [Distributed environment dispatching](#distributed-environment-dispatching)
* [Dispatching options:](#dispatching-options)
* [Disable priority synchronization](#disable-priority-synchronization)
* [Development](#development)
* [Setup with Docker](#setup-using-docker)
* [Running tests](#running-tests)
Expand Down Expand Up @@ -60,7 +61,7 @@ Add the following to your `rebar.config` file:

1. Add `blockade` as a dependency
```erlang
{deps, [{blockade, "0.2.0"}]}.
{deps, [{blockade, "0.2.1"}]}.
```

2. Start `blockade` under your supervision tree
Expand Down Expand Up @@ -170,7 +171,7 @@ By default `blockade` will dispatch events to all subscribers across the cluster
> Blockade.dispatch(:my_event_queue, :some_event_key, "local_dispatch", %{members: :local})
:ok
```

Disable priority synchronization
### Dispatching options:
- `members` - define which members should receive the event. available options are:
- `global` - dispatch event to all members within the cluster.
Expand All @@ -191,6 +192,7 @@ This can be achieved by setting the `priority_sync` option to `false` when start
Also keep in mind to set the `local_priority_set` option to `true` when setting the priority level
or dispatching events with priority option.

Elixir:
```elixir
alias :blockade, as: Blockade

Expand All @@ -209,12 +211,13 @@ end

# Dispatch event with priority level 100 and keep it local to the node.
> Blockade.dispatch(:my_event_queue, :some_event_key, "priority_test", %{
priority: 100,
local_priority_set: true,
atomic_priority_set: true
priority: 100,
local_priority_set: true,
atomic_priority_set: true
})
```

Erlang:
```erlang
init(Args) ->
Children = [
Expand All @@ -233,7 +236,6 @@ blockade:dispatch(my_event_queue, some_event_key, "priority_test", #{
atomic_priority_set => true}).
```


> **Note**
> If dispatching events to all members across the cluster is not desired, you can start `blockade` with different names on different nodes. This way you can have multiple event queues within the cluster each completly isolated from each other. For example you can use the local node name as the event queue name which is unique in the cluster.
Expand Down
2 changes: 1 addition & 1 deletion src/blockade.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{application,
blockade,
[{description, "Event queue with priority levels"},
{vsn, "0.2.0"},
{vsn, "0.2.1"},
{registered, []},
{applications, [kernel, stdlib]},
{env, []},
Expand Down

0 comments on commit d99f036

Please sign in to comment.