Skip to content

Conversation

@timacdonald
Copy link
Member

@timacdonald timacdonald commented Nov 26, 2025

Continuation of the great work done in #156 by @nandi95

Adds support for an optional new contract that allows for more efficient batch updates.

Our first party drivers implement the driver by default.

->map(fn ($bits) => ['feature' => $bits[0], 'scope' => $bits[1], 'value' => $value])
->all();

$this->driver->setAll($features);
Copy link
Member Author

Choose a reason for hiding this comment

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

$this->driver is our decorator which implements the new contract, so calling setAll here is safe.

->map(fn ($bits) => ['feature' => $bits[0], 'scope' => $bits[1], 'value' => false])
->all();

$this->driver->setAll($features);
Copy link
Member Author

Choose a reason for hiding this comment

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

$this->driver is our decorator which implements the new contract, so calling setAll here is safe.

/**
* Set multiple feature flag values.
*
* @internal
Copy link
Member Author

Choose a reason for hiding this comment

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

Marked as internal so it doesn't show up on the Facade. This isn't meant to be called directly by the consuming application.

@timacdonald timacdonald changed the title Set all Improve performance of setting multiple feature values at once Nov 26, 2025
@timacdonald timacdonald marked this pull request as ready for review November 26, 2025 23:51
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.

3 participants