Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Callback support in v3.0 #73

Open
SzybkiSasza opened this issue Sep 8, 2014 · 3 comments
Open

Callback support in v3.0 #73

SzybkiSasza opened this issue Sep 8, 2014 · 3 comments

Comments

@SzybkiSasza
Copy link

Hello,
I'm trying to write simple client to test connection between different socket.io-powered apps. I would like to know how to implement callback mechanism in elephant.io v3.0, I wasn't able to find it in the code. I tried to use $client->read(), however I don't see how it could be used to intercept asynchronous messages as in v2.0 $elephant->callback() should do. What's more - using $client-read() in loop leads to program hanging on second iteration (data is read from socket PARTIALLY and then - program hangs when trying to read data again).

@Taluu
Copy link
Contributor

Taluu commented Jan 30, 2015

Hi, first thing, sorry for the delay.

The client->read() method is bugged right now (cf #74), as it stands more like a POC actually rather than a correct implementation. There is a solution, but I'm not really satisfied with it.

I'm keeping your ticket open, because there is no support yet for callbacks (especially as it depends on reading from a socket)

@Taluu Taluu removed the 3.0 label Jan 30, 2015
@luciuz
Copy link

luciuz commented May 26, 2016

callbacks anyone?

@marianoarga
Copy link

+1

@Taluu Taluu mentioned this issue Nov 3, 2016
DiaconuFlorinNarcis added a commit to DiaconuFlorinNarcis/elephant.io that referenced this issue May 29, 2017
The kind of change this PR does introduce

- [x]  a bug fix
- [ ]  a new feature
- [x]  an update to the documentation
- [x]  a code change that improves performance
- [ ]  other

Current behavior
Client->read() is hanging the script until data is received.
New behavior
Client->read() will return empty string if no data is received.
Other information (e.g. related issues)
This answers Wisembly#73, Wisembly#149, Wisembly#137 and perhaps Wisembly#60
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants