Skip to content

paywithcurl/Medusa

Repository files navigation

Medusa

About

Medusa is a Pub/Sub system that leverages GenStage.

You should declare routes in String like the following examples:

Medusa.consume "foo.bar", &Honey.doo/1   # Matches only "foo.bar" events.
Medusa.consume "foo.*" &Lmbd.bo/1        # Matches all "foo. ..." events

Then, to publish something, you call:

Medusa.publish "foo.bar", my_awesome_payload

Caveats

It can only consume functions of arity 1.

Installation

If available in Hex, the package can be installed as:

  1. Add medusa to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:medusa, "~> 0.1.0"}]
end
```
  1. Ensure medusa is started before your application:
```elixir
def application do
  [applications: [:medusa]]
end
```

Contributing

Run tests with the included test script. Arguments pasted to this script will be forwarded to mix test. This allows the test runner to execute single tests.

./run_test.sh
./run_test.sh test/my_test:10

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published