Skip to content

Commit

Permalink
Bump version to 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaturan committed Feb 18, 2018
1 parent 5dc63ee commit 3948984
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Current
## [1.1.X] - 2018.02.17

### Added

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The package can be installed by adding `event_bus` to your list of dependencies

```elixir
def deps do
[{:event_bus, "~> 1.0.0"}]
[{:event_bus, "~> 1.1"}]
end
```

Expand Down Expand Up @@ -442,11 +442,13 @@ EventBus optionally allows you to track `:register_topic`, `:unregister_topic`,

Note: Enabling optional system events decreases the EventBus performance because it at least doubles the operation calls. It is not recommended to enable these events unless you certainly require to track these events espcially `notify`, `mark_as_completed` and `mark_as_skipped`.

Enabling observable events only can be done on compile time. Thus, you need to add it to your app configuration. Here is sample configuration to subscribe optional system events:
Enabling observable events only can be done on compile time (It's good idea to delete your cached build via `rm -rf _build`). Thus, you need to add it to your app configuration. Here is sample configuration to subscribe optional system events:

```elixir
config :event_bus,
observables: ~w(register_topic unregister_topic subscribe unsubscribe notify mark_as_completed mark_as_skipped)a,
id_generator: fn -> :base64.encode(:crypto.strong_rand_bytes(8)) end,
#id_generator: fn -> UUID.uuid4() end
...
```

Expand Down
25 changes: 12 additions & 13 deletions lib/event_bus.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
defmodule EventBus do
@moduledoc false
@moduledoc """
Traceable, extendable and minimalist event bus implementation for Elixir with
built-in event store and event watcher based on ETS
"""

use EventBus.EventSource
alias EventBus.{Notifier, Store, Watcher, Subscription, Topic}
Expand Down Expand Up @@ -141,11 +144,9 @@ defmodule EventBus do
"""
@spec subscribe(tuple()) :: :ok
def subscribe({listener, topics}) when is_observable(:subscribe) do
unless Enum.member?(subscribers(), {listener, topics}) do
EventSource.notify sys_params() do
Subscription.subscribe({listener, topics})
%{action: :subscribe, listener: listener, topics: topics}
end
EventSource.notify sys_params() do
Subscription.subscribe({listener, topics})
%{action: :subscribe, listener: listener, topics: topics}
end

:ok
Expand All @@ -169,13 +170,11 @@ defmodule EventBus do
:ok
"""
@spec unsubscribe(tuple()) :: :ok
def unsubscribe({listener}) when is_observable(:unsubscribe) do
if Enum.member?(subscribers(), {listener}) do
EventSource.notify sys_params() do
Subscription.unsubscribe({listener})
%{action: :unsubscribe, listener: listener}
end
@spec unsubscribe({tuple() | module()}) :: :ok
def unsubscribe(listener) when is_observable(:unsubscribe) do
EventSource.notify sys_params() do
Subscription.unsubscribe(listener)
%{action: :unsubscribe, listener: listener}
end

:ok
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule EventBus.Mixfile do
def project do
[
app: :event_bus,
version: "1.0.0",
version: "1.1.2",
elixir: "~> 1.5",
elixirc_paths: elixirc_paths(Mix.env()),
build_embedded: Mix.env() == :prod,
Expand Down

0 comments on commit 3948984

Please sign in to comment.