anuaralfetahe

anuaralfetahe

Blockade - event dispatching with priority levels

Hey there BEAM community!

I’m happy to share with you my latest creation. Erlang library called Blockade. This library was born out of a personal need and a desire to improve event handling in Erlang/Elixir projects. After searching for existing solutions, I found that nothing quite all my requirements. There are many nice libraries such as Phoenix PubSub but they do not offer event filtering. So, I rolled up my sleeves and developed Blockade.

Main features

  • Subscribe to events
  • Dispatch events
  • Filter events by priority level
  • Discard events by priority level

Blockade is built on top of Erlang pg module which actually does the heavy lifting and provides the distributed features meaning events can be dispatched to all subscribers in the Erlang cluster, subscribers (processes) who die will be automatically removed from the subscribers list.

A Real-World Use Case

Let me share a real-world scenario where Blockade shines. Imagine you have a system processing critical transactions. During this time, you need to ensure that no other transactions are processed concurrently, as it could lead to inconsistencies. By leveraging Blockade, you can simply set a higher priority level on the event queue, effectively creating a blockade that locks all resources. This way, any other events in the queue will wait until the transaction processing is complete. Once the transaction finishes, resetting the priority level will automatically unleash the queued events.

https://hexdocs.pm/blockade/0.1.0/readme.html

Happy coding!

Where Next?

Popular in Libraries Top

mhanberg
I just released the first version of Temple: an HTML DSL for Elixir and Phoenix! You can read this blog post or the docs for more info...
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
sabiwara
Dune is a sandbox for Elixir and aims to safely evaluate user-provided code. You can try it out using this basic Elixir playground made ...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
cjen07
parameterized pipe in elixir: |n> edit: negative index in |n> and mixed usage with |> are supported example: use ParamP...
New
mindok
What is ContEx? A pure Elixir server-side data plotting/charting library outputting SVG. It has nice barcharts in particular and works g...
New
benlime
I created a new library GitHub - benvp/ex_cva: Class Variance Authority for Elixir which aims to make it very easy to define different va...
New
KallDrexx
For a good number of months I've been working on creating a very basic RTMP live video streaming server. Now that I have a very, very ba...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
381 12391 119
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Sub Categories:

We're in Beta

About us Mission Statement