php-cassandra-binary icon indicating copy to clipboard operation
php-cassandra-binary copied to clipboard

Multi-threading

Open ocyedwin opened this issue 10 years ago • 3 comments

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

ocyedwin avatar Dec 11 '14 10:12 ocyedwin

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/

LarsFronius avatar Dec 11 '14 14:12 LarsFronius

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?

ocyedwin avatar Dec 11 '14 14:12 ocyedwin

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...

danielsand avatar Dec 11 '14 15:12 danielsand