Questions tagged [reactphp]

React is a low-level library for event-driven programming in PHP.

Event-driven, non-blocking I/O with PHP. http://reactphp.org/ React is a low-level library for event-driven programming in PHP. At its core is an event loop, on top of which it provides low-level utilities, such as: Streams abstraction, async dns resolver, network client/server, http client/server, interaction with processes. Third-party libraries can use these components to create async network clients/servers and more.

The event loop is based on the reactor pattern (hence the name) and strongly inspired by libraries such as EventMachine (Ruby), Twisted (Python) and Node.js (V8).

172 questions
0
votes
1 answer

How to create asynchronous socket server using php?

I'm trying to create a Asynchronous socket server to handle socket client, send message to client when it's needs. I use reactphp library to implement it but I can't do correct, my server still is blocked. I'm new in this library, please…
Loint
  • 3,560
  • 7
  • 26
  • 46
0
votes
3 answers

Passing data between different PHP instances

index.php is parsed by Apache. It needs to pass some data to another PHP instance which happens to be a reactphp loop. How can this be best accomplished? Both scripts are run on the same…
user1032531
  • 24,767
  • 68
  • 217
  • 387
0
votes
1 answer

reactPHP process start blocking timer

I have here a reactPHP loop with two timer events: $loop = \React\EventLoop\Factory::create(); $process = new \React\ChildProcess\Process("php wait5seconds.php"); $process->on('exit', function($exitCode, $termSignal) { echo "Process…
Grigory Ilizirov
  • 1,030
  • 1
  • 8
  • 26
0
votes
1 answer

ReactPHP: What is the difference between terminate process and close process?

Using the reactphp/child-process library, $loop = React\EventLoop\Factory::create(); $process = new React\ChildProcess\Process(...some long proccess..); $process->on('exit', function($exitCode, $termSignal) { //…
Grigory Ilizirov
  • 1,030
  • 1
  • 8
  • 26
0
votes
2 answers

ReactPHP http server for each user, Is this a good idea?

ReactPHP http server for each user, Is this a good idea? In my application: Each logged on user sends and receives data from server. In average one request per second. After server response, the server have some extra work to do, which is related…
Grigory Ilizirov
  • 1,030
  • 1
  • 8
  • 26
0
votes
1 answer

Cakephp 3: React/zmq library namespace

I am working on on the basic tutorial on using ratchet mentioned here http://socketo.me/docs/push. I have created a test setup for the tutorial that works flawlessly. However, when I am trying to integrate the setup with CakePHP 3 I am running into…
i01000001
  • 119
  • 1
  • 2
  • 9
0
votes
1 answer

How to use Rachet to create multiple servers on a single machine

The situation is I spin up a Rachet socket server with a shell script like this $webSocketServer = new WsServer(new Chat()); $originCheck = new OriginCheck($webSocketServer, ['xdomain.com']); $server = IoServer::factory( new…
Raheel
  • 8,716
  • 9
  • 60
  • 102
0
votes
1 answer

Composer React Php

I am newbie. Trying to install react php to make a asynchronous server. I installed it using composer require react/react. And then included the autoload.php in the code. But it is not able to autoload the required files. I have written this…
Tushar Kundra
  • 29
  • 2
  • 6
0
votes
0 answers

ReactPHP - Timing the length of time it took to send a UDP packet?

I'm currently using the ReactPHP Event Loop and ReactPHP Datagram (which can be found here: https://github.com/reactphp/datagram). At the moment, I'm using the Datagram client to connect to a UDP server and send packets to it every ~20ms, however, I…
cheese5505
  • 962
  • 5
  • 14
  • 30
0
votes
0 answers

Guzzle and react Promise cause infine loop

I use Guzzle 6 to call asynchrous request and I then use React Promise/Deferred and Event loop , then I use php-react-block to get result by resolved. Firstly I send http Request as following: public function callService($endpoint){ …
yunus kula
  • 859
  • 3
  • 10
  • 31
0
votes
0 answers

Authentication through WebSocket

I'm using Ratchet (based on ReactPHP) to host a WebSocket server which needs the users Oauth token for connecting to Twitter. How should I authenticate the user on it safely?
Isty001
  • 144
  • 1
  • 11
0
votes
1 answer

Asynchronous snmp get calls in PHP

is there a good way to make some PHP calls asynchronous, non-blocking? For example, take a look at this simple code:
Boban P.
  • 183
  • 2
  • 5
0
votes
1 answer

Upstart ReactPHP Script - AWS EC2 ElasticbeanStalk

I have a php script that runs in a never ending loop using ReactPHP Loop and HTTPServer Now, I am using an AWS Elastic Beanstalk Worker which reads an SQS queue for which HTTPServer on port 80 is required. Here is my PHP Script:
Guns
  • 2,678
  • 2
  • 23
  • 51
0
votes
1 answer

Basic react http server and websocket server at the same time

I managed to create a web service that listens on port 80 for http requests and handles ajax calls and also long polling. But I'm stuck at creating a similar websocke server in the same php file
vlad b.
  • 695
  • 5
  • 14
0
votes
1 answer

Publish to subscribed clients at scheduled times using reachphp or ratchet

I'm new to reactphp. I dabbled in node.js. I'm researching a project that requires events to fire at specific times and get published to the subscribed clients. Is this something that the EventLoop would be suited for? Any direction for how I could…
Alan Quigley
  • 1,642
  • 2
  • 15
  • 19
1 2 3
11
12