Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Allow Separate Backend and Broker #42

Merged
merged 8 commits into from
Jul 21, 2015
Merged

Allow Separate Backend and Broker #42

merged 8 commits into from
Jul 21, 2015

Conversation

m0nk
Copy link
Contributor

@m0nk m0nk commented Nov 19, 2014

This pull request will allow the user to specify a separate broker from their back end. So using Redis for results and rabbitmq for pushing tasks. The Celery Constructor will now take two arrays as parameters the first being connection details for the broker and the second being (optionally) connection details for the back end. A simple array would look like this.

$brokerConnection = array(
"host" => "localhost",
"login" => "gdr",
"password" => "test",
"vhost" => "wutka",
"exchange" => "celery",
"binding" => "celery",
"port" => 5672,
"connector" => "php-amqplib"
);
$c = new Celery($brokerConnection);

@gjedeer
Copy link
Owner

gjedeer commented Nov 20, 2014

Wow. This is a huge change.

I appreciate the effort but not only it breaks the current API, it also deletes the inline phpdocumentor documentation, so I'm not going to merge it as is.

If you want to see these changes merged, please fix these problems. Otherwise it needs to wait until somebody - perhaps me - has the time to do it without breaking existing code.

@m0nk
Copy link
Contributor Author

m0nk commented Nov 20, 2014

I will see what I can do. If you by chance caught my modifications to AsyncResult I have removed those (I don't feel they are quite ready to be merged yet and included them by accident)

@gjedeer
Copy link
Owner

gjedeer commented Nov 20, 2014

Yeah, these too. Also the change in constructor arguments - we can't have breaking changes like this.

Yesterday I've updated celery-php in a project I wrote in 2011 for a client and after "git pull" it worked like nothing happened. This is the level of stability this project is aiming at.

… have been changed to connect via the old method as well. Setting the backend on Celery and connecting with arrays can be done using the class CeleryWithBackend
@m0nk
Copy link
Contributor Author

m0nk commented Nov 20, 2014

I have added a new commit. This will allow the class Celery to be used as it has always been and included a new class CeleryWithBackend (lack of a better name) that will be setup by passing the two arrays. I couldn't come up with a better way to do this so any feedback you have to offer would be appreciated. I will work out my documentation breaking later on today if this seems to fit for you.

@gjedeer gjedeer merged commit 5a9fe40 into gjedeer:master Jul 21, 2015
@gjedeer
Copy link
Owner

gjedeer commented Jul 21, 2015

Sorry it took so long to merge, your PR still required some work to be usable and I was too busy with paid work.

@m0nk
Copy link
Contributor Author

m0nk commented Jul 21, 2015

Not a problem at all. It is your project so you need to ensure quality is maintained. I am glad my changes were able to help out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants