Tuesday, October 16, 2018

How to connect two random people in a single thread using Laravel Broadcasting

Leave a Comment

I'm creating a random real-time chat, like Omegle.

I'm having trouble to connect two random people in a private thread using a wait list. What would be the best way to do it using Laravel Broadcasting and Laravel Job?

For example:

Route::get('/start', function () {     // add me to the wait list     // wait for another person     // find another person     // remove me and another person from the wait list      // dispatch event     App\Events\AnotherPersonFound::dispatch($anotherPerson, $threadId); }); 

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment