Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doc and add child spec #85

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

bighelmet7
Copy link
Contributor

I am in the process of learning how the static_supervisor works, and I noticed that the significant property wasn't added to the convert_child. According to the Erlang documentation:

child_spec() = #{id => child_id(),             % mandatory
                 start => mfargs(),            % mandatory
                 restart => restart(),         % optional
                 significant => significant(), % optional
                 shutdown => shutdown(),       % optional
                 type => worker(),             % optional
                 modules => modules()}         % optional

We should be able to pass the ChildBuilder.significant to the convert_child which then will be passed to the supervisor:start_link.

Example of how the significant spec gets passed to running worker_child

    offender: [{pid,<0.864.0>},
               {id,<<"worker">>},
               {mfargs,{erlang,apply,
                               [#Fun<gleam@otp@static_supervisor.0.87899615>,
                                []]}},
               {restart_type,temporary},
               {significant,true},
               {shutdown,5000},
               {child_type,worker}]

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!!

@lpil lpil merged commit a473a19 into gleam-lang:main Nov 15, 2024
1 check passed
@bighelmet7 bighelmet7 deleted the fix-doc-and-add-child-spec branch November 20, 2024 18:14
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