Comments (3)
Hey, thanks for the heads up.
Note, the following is based only on reading the Laravel code, I haven't tested anything.
Looks like for pipelines, they pass the PhpRedis client instance itself to the closure, instead of the Laravel's Redis connection, which dispatches the command-executed events.
Redis::pipeline(function ($pipe) {
// This is PhpRedis instance, so Laravel has no idea what commands I'm calling.
$pipe->get('foo');
});
I think they could literally just replace the PhpRedis instance with Laravel's Redis connection and it should "just work", since it passes all calls to the same PhpRedis instance internally.
This means simply replacing $pipeline
with $this
on this line:
https://github.com/laravel/framework/blob/10.x/src/Illuminate/Redis/Connections/PhpRedisConnection.php#L405
Redis::pipeline(function ($pipe) {
// This is now the same as calling Redis::get, so Laravel dispatches command-executed events.
$pipe->get('foo');
// Or you can literally just do this, without any changes to Laravel code and it should do the same thing
Redis::get('foo');
});
I don't feel like working on this PR myself, but if anyone else wants to, I'm down to help.
from clockwork.
That is amazing.
I can confirm that using Redis::get('foo'); inside the pipeline closure really works. And it still uses the pipeline method. I was afraid it would go back to sending them one by one, but it really works.
Then if someone wants to do a PR to Laravel it would be even better as it will fix any code. But as I am not comfortable enough to do it I will change to using Redis::get in my code for now.
from clockwork.
@itsgoingd I am familiar with Laravel, PHP and I want to contribute to this, can you help me in how to start with raising a PR.
from clockwork.
Related Issues (20)
- Profiler Tab stuck on "Loading profile" HOT 7
- Profiler support when using Slim 4 HOT 2
- Typo in `Request::addModelAction()` HOT 2
- Argument 6 passed to Symfony\Component\HttpFoundation\Cookie::__construct() must be of the type boolean, null given, called in vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkSupport.php on line 438 HOT 6
- Using MonologDataSource trigger error HOT 2
- Store method doesn't work (returns 404) HOT 4
- Compatibility with Doctrine DBAL 3 HOT 1
- (Laravel) Chrome extension has option to "Load more", but the web page doesn't? HOT 1
- Show listeners in events data source HOT 1
- Changed default behavior HOT 3
- Slack Message Notification tries to access protected property HOT 5
- Serialization Failure in Clockwork Due to Incomplete Object Representations HOT 5
- Bug: Exception when Notification class missing toArray() method HOT 2
- Symfony 7 Compatibility issues HOT 3
- Where is the response in this? HOT 4
- addDatabaseQuery does not increase queries count HOT 2
- Laravel 11 support HOT 2
- Profile is not present for current request HOT 1
- No such file in iframe.html.php HOT 3
- Installed Clockwork and it broke my app? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clockwork.