#Glyn: Type-safe PubSub and Registry for Gleam actors, built on Syn

1 messages · Page 1 of 1 (latest)

unkempt python
#

My first gleam library! https://github.com/mbuhot/glyn

It's a wrapper over syn (https://github.com/ostinelli/syn) that integrates with Gleam's typed actor system with Subjects and Selectors.

Creating this finally made the typed actor system to click for me, I had to re-wire my brain after years of untyped messaging in Elixir 🙂
Being able to select_map multiple Subjects into a single Actor mailbox feels like a new super power.

My next goal is to use this to build a distributed chat app with websockets in Wisp.

GitHub

Type-safe PubSub and Registry for Gleam actors with distributed clustering support, built on Syn. - mbuhot/glyn

GitHub

A scalable global Process Registry and Process Group manager for Erlang and Elixir. - ostinelli/syn

grave wagon
#

Oooh useful!!

limber raft
#

👀

grave wagon
#

Do you know how the groups scale? pg for example is better with many small groups, or larger groups with infrequent leaving, as member removal uses lists:remove

#

The start function doesn’t return a Started and the supervised function is missing. Would be great to have those so it can be used in real programs with supervision

#

What’s the glyn module for? It defines one type and but I can’t see where it’s ised

#

Oh it’s used in the constructor for the pubsub registry. This isn’t type safe!

#

It looks like you could get rid of that argument though and it would become type safe?

unkempt python
#

Making it type safe in a distributed setting might be impossible?, but the MessageType(message) was an attempt to minimize the chance of misuse.
Essentially I need some tag to use for the subject that corresponds to the message type that will be published.
Very open to suggestions 🙏

unkempt python
#

Could you provide some more details on the supervision?
If Glyn is a library that doesn't directly supervise any processes, but has a dependency on Syn which is an OTP application with supervision tree, will an app that depends on Glyn automatically start Syn?

grave wagon
#

Oh so it uses some implicit global state instead of managing processes directly

grave wagon