manhvu

manhvu

I try to make new supervisor for developer can easy to add & manage processes.

For current supervisors, that is based on OTP & suitable for telecom application and need to think too much for design.
I made a all in one & flat supervisor for newbies can jump and use easily.

Basic idea in here is separated process follow group/chain/standalone.
Support for add all processes from config or by runtime.

Supervisor now can work in basic, you can get it from hex.pm or access source code from Github.com

Basic example:

# Start a supervisor with 2 partitions & 2 groups:
alias SuperWorker.Supervisor, as: Sup

# Config for supervisor
opts = [id: :sup1, number_of_partitions: 2, link: false]

# Start supervisor
Sup.start(opts)

# Add group in runtime, you also can add group in config.
Sup.add_group(:sup1, [id: :group1, restart_strategy: :one_for_all])
Sup.add_group_worker(:sup1, :group1, {Dev, :task, [15]}, [id: :g1_1])

Sup.add_group(:sup1, [id: :group2, restart_strategy: :one_for_one])
Sup.add_group_worker(:sup1, :group2, fn ->
  receice do
  msg ->
    :ok
  end
end, [id: :g2_2])

I’m still working on this and update more details in later!

https://github.com/ohhi-vn/super_worker

Showing Posts 1 to 6

asianfilm

asianfilm

All I’m gonna say is that you missed the golden opportunity of creating a library called ÜberWorker.

manhvu

manhvu OP

Do you have a link of that library?

asianfilm

asianfilm

Sorry. I mean if you dodge lawsuits and Hex can manage umlauts, it would be a cooler name. I forget if it is Ruby that is particularly into puns when naming libraries/packages.

manhvu

manhvu OP

oh, I think I named my library a long time ago when I start my project. Maybe another name is better for library. Thank you!

dimitarvp

dimitarvp

This looks nice, thank you. I would use the chain workers but would be worried about lack of persistence i.e. if we have a chain of 5 steps and the app is restarted while step 3 is executing, I would want step 3 to begin executing anew after the app starts again.

I realize this is no longer a “normal” supervisor logic and goes into the territory of persistent job queues. I am sharing what I would find useful.

manhvu

manhvu OP

Yes, persistence is lacked. I think in the future I will add a new feature to store state of chain to Ets table or external db.

The idea of supervisor came from my basic use cases and still have a lot of thinks to do.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
akoutmos
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews