event loop

25 views
Skip to first unread message

web

unread,
May 24, 2017, 8:13:13 AM5/24/17
to DataStax PHP Driver for Apache Cassandra User Mailing List
Hello

How can I execute commands asynchronously using PHP ?
I want to use event loop and when the result is ready , Get it with events (I don't want wait for result - non-blocking )

Michael Penick

unread,
May 24, 2017, 2:25:47 PM5/24/17
to php-dri...@lists.datastax.com
Hi, 

From the the ticket PHP-190:

"Currently, the best wait do do this is to use `Session::executeAsync()` and poll the resulting future using the method `FutureRows::get($timeout)` with a very small timeout (or 0). We're are unable to provide a callback mechanism because the event loops that handle I/O are on a different thread from PHP's main thread and there's not a mechanism for running PHP code on a thread outside of the PHP interpreter. It's possible in the future we'll re-architect the underlying C/C++ driver to be more flexible in supporting this type of scenario, but it's not something we can solve in the short-term. To support that scenario we would need to run all the I/O in an event loop that the application could control which is very different from the assumptions of the current architecture."

Mike




--
You received this message because you are subscribed to the Google Groups "DataStax PHP Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-driver-user+unsubscribe@lists.datastax.com.

socket...@gmail.com

unread,
Dec 13, 2017, 6:33:45 AM12/13/17
to DataStax PHP Driver for Apache Cassandra User Mailing List
What about today?
Reply all
Reply to author
Forward
0 new messages