Skip to content

Conversation

@mikehostetler
Copy link
Contributor

Summary

Adds instance isolation support for multi-tenant deployments where each tenant can have completely isolated signal infrastructure.

Changes

New modules:

  • Jido.Signal.Names - Resolves process names based on jido: option
  • Jido.Signal.Instance - Child spec for starting isolated supervisor trees

Updated modules:

  • Jido.Signal.Util - via_tuple/2 and whereis/2 support jido: option
  • Jido.Signal.Bus - Stores jido option in state
  • Jido.Signal.Bus.State - Added jido field
  • Jido.Signal.Ext.Registry - Added child_spec/1 for instance naming

Usage

# Start isolated instance
{:ok, _} = Jido.Signal.Instance.start_link(name: MyApp.Jido)

# Bus uses instance-scoped registry
{:ok, _} = Bus.start_link(name: :tenant_bus, jido: MyApp.Jido)

# Multiple instances are completely isolated
{:ok, _} = Instance.start_link(name: TenantA.Jido)
{:ok, _} = Instance.start_link(name: TenantB.Jido)

# Same bus name, different instances = different processes
{:ok, bus_a} = Bus.start_link(name: :events, jido: TenantA.Jido)
{:ok, bus_b} = Bus.start_link(name: :events, jido: TenantB.Jido)

Documentation

  • Updated README, AGENTS.md, usage-rules.md
  • Added Instance Isolation section to guides/event-bus.md
  • Added testing patterns to guides/advanced.md

Tests

  • 14 new tests for Names, Instance, and Bus isolation

…yments

- Add Jido.Signal.Names module for instance-scoped process name resolution
- Add Jido.Signal.Instance module for starting isolated supervisor trees
- Update Util.via_tuple/2 and Util.whereis/2 to support jido: option
- Add jido field to Bus.State for storing instance scope
- Add child_spec/1 to Ext.Registry for instance-scoped naming
- Update documentation: README, AGENTS.md, usage-rules.md, guides

Instance isolation enables:
- Multi-tenant signal infrastructure with complete isolation
- Same bus names in different instances = different processes
- Easy testing with isolated instances per test
@mikehostetler mikehostetler merged commit f873ea1 into main Jan 23, 2026
6 checks passed
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