Skip to content

Add ra_system_sup:child_spec/1 builder - #650

Open
the-mikedavis wants to merge 1 commit into
mainfrom
md/system-child-spec-builder
Open

Add ra_system_sup:child_spec/1 builder#650
the-mikedavis wants to merge 1 commit into
mainfrom
md/system-child-spec-builder

Conversation

@the-mikedavis

Copy link
Copy Markdown
Collaborator

This allows other OTP applications to start a system under their own supervision tree, rather than the dynamic ra_system_sup supervisor. This makes for finer control over lifecycle, for example making it possible for a consuming application to naturally terminate itself if the system goes down, if the system is a critical part of the application.

The child_spec/1 builder is pretty trivial

child_spec(#{name := Name} = Config) ->
    #{id => Name,
      type => supervisor,
      start => {?MODULE, start_link, [Config]}}.

This change also moves the ownership of the {'$ra_system', Name} from ra_systems_sup into a separate server so that it is set and cleared consistently.

See #585

This allows other OTP applications to start a system under their own
supervision tree, rather than the dynamic `ra_system_sup` supervisor.
This makes for finer control over lifecycle, for example making it
possible for a consuming application to naturally terminate itself if
the system goes down, if the system is a critical part of the
application.
@the-mikedavis the-mikedavis self-assigned this Aug 10, 2026
@mergify

mergify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

1 participant