Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-threading #50

Open
ocyedwin opened this issue Dec 11, 2014 · 3 comments
Open

Multi-threading #50

ocyedwin opened this issue Dec 11, 2014 · 3 comments

Comments

@ocyedwin
Copy link

Hi,

What is the equivalent of Java multi-threading or executeAsync() when using php-cassandra-binary or developing for Cassandra in PHP in general?

How do I achieve non-blocking, concurrent read/writes to boost throughput?

Thanks,
Edwin

@LarsFronius
Copy link
Collaborator

Assuming you are not trolling PHP here.
There is in fact no real async/threading option available in PHPs core.
You can do some hacks on socket connections as we use them in this library by closing them before waiting for replies and setting them to non blocking. This is not async, this has nothing do to with threading and you won't get to know response values. https://segment.com/blog/how-to-make-async-requests-in-php/

@ocyedwin
Copy link
Author

Haha, no I'm not trolling. I've did some benchmark with cassandra-stress, and it seems like they are achieving their high throughput by threading. I'm wondering how can i achieve such performance using PHP. Any advice?

@danielsand
Copy link

hurm :)
like Lars pointed out before - there is no easy way of doing this in PHP - because its not designed for this :P
the blog post he posted is an approach of trying to achieve what you are looking for...

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

No branches or pull requests

3 participants