Skip to content

26: Say what boot() being idempotent costs - #40

Open
nikolaystrikhar wants to merge 1 commit into
25-config-messagesfrom
26-boot-idempotence
Open

26: Say what boot() being idempotent costs#40
nikolaystrikhar wants to merge 1 commit into
25-config-messagesfrom
26-boot-idempotence

Conversation

@nikolaystrikhar

Copy link
Copy Markdown
Contributor

What: Absorber::boot()'s docblock and docs/configuration.md state what idempotence costs — the first call's container is the one the library keeps.

Usage:

Config::set_container( $container ); // first, always
Absorber::boot();                    // and not the other way round

Why this way:

Idempotent was true and insufficient. boot() returns early on $booted, so a set_container() afterwards binds nothing. Boot\Scheduler keeps the container it closed over, while the accessors and both notice trampolines resolve from whatever Config holds when they fire — so the two halves answer to different containers, and a queued merge notice can never render and never clear.

Stated rather than fixed. Re-running the provider against a second container would make the boot sequence depend on how many containers a host happened to go through, which is a worse rule than the one it relaxes. The recommended shape already prevents it: set the container at plugins_loaded priority 0, before booting.

The docblock claimed idempotence and stopped there. What it did not say is
that the container is part of what the first call wins: a set_container()
afterwards binds nothing, the scheduler keeps the container it closed over,
and the accessors and notice trampolines resolve from whatever Config holds
when they are called -- so the two halves answer to different containers and
a queued notice can never render and never clear.

Stated rather than fixed. Re-running the provider against a second container
would make the boot sequence depend on how many containers a host went
through, which is worse than the rule it would relax.
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