Skip to content

Conversation

@axlon
Copy link
Contributor

@axlon axlon commented Jan 20, 2021

When a callback is passed to the block method on a cache lock, the lock will return the return value of the callback instead of a boolean. Because of this it would make more sense if the method's return type is mixed.

E.g.:

Cache::lock('myLock')->block(3, fn () => 10)); // Returns 10

@taylorotwell taylorotwell merged commit 9f0180f into laravel:8.x Jan 20, 2021
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