Skip to content

Add circuit_breaker package#257

Open
manelsen wants to merge 1 commit into
gleam-lang:mainfrom
manelsen:add-circuit-breaker
Open

Add circuit_breaker package#257
manelsen wants to merge 1 commit into
gleam-lang:mainfrom
manelsen:add-circuit-breaker

Conversation

@manelsen

Copy link
Copy Markdown

Summary

  • Adds circuit_breaker (category: Erlang and OTP) — circuit breaker for Gleam with closed, open, half-open state machine and OTP actor support

Package

The package provides a pure state machine for circuit breaker logic, an OTP actor for thread-safe multi-key management, and a global registry via persistent_term. Published on Hex, v2.0.0.

@lpil

lpil commented Apr 23, 2026

Copy link
Copy Markdown
Member

Thank you, but there's some issues that makes me reluctant to add this to the awesome list:

  • The private internals of the gleam_erlang library is being violated in the Erlang FFI.
  • The persistent term storage system is being misused to create a name-like system.
  • The start function doesn't return [actor.Started](https://hexdocs.pm/gleam_otp/1.2.0/gleam/otp/actor.html#Started)
  • The supervised function is absent.
  • The API is split across 3 modules and 2 of them have very generic names. "actor" especially is going to clash for users.
  • The API and documentation are a bit confusing, so it is not clear to be how the library is intended to be used.
  • The names such as cb and check_and_call were confusing to me, as they don't seem to match what the code does.

This list is used as a reference for folks and to find production-suitable dependencies, so we want the code added to be as good as possible!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants