Skip to content

Conversation

@banks
Copy link

@banks banks commented Jan 31, 2014

@adoy, thanks for this lib allowed me to test proof of concept quickly.

This is a quick hour's pass through the lib but I wanted to share the changes back with you. They are unfortunately only tested with trivial ad-hoc script but I will probably be using this library extensively in a new project so will contribute back any further changes.

This change allows stuff like:

for ($i = 0; $i < 3; $i++) {
    $req_ids[] = $client->async_request($params, false);
} 

// Do other stuff while they all process in parallel (assuming your FastCGI application is multi-threaded)

foreach ($req_ids as $id) {
    $response = $client->wait_for_response($id);
}

I will use this as basis of an Async RPC framework using FastCGI applications as backend services to a PHP web app.

Any thoughts/clean up requests welcome.

adoy added a commit that referenced this pull request Feb 5, 2014
Support multiplexing multiple async requests over persistent socket
@adoy adoy merged commit be26b09 into adoy:master Feb 5, 2014
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