Comments (3)
It should. if chan_reply_8
is received, then cancelRefEvent()
will be called which will call this.channel.off(this.refEvent)
Not saying there isn't a bug somewhere, but this is at least the intended logic
from javaphoenixclient.
The timeout message never triggers the added reply binding is what I am saying. The timeout message looks like PhxMessage(ref=chan_reply_8, topic=, event=, payload={status=timeout}, joinRef=null)
. Note that the topic and event are empty.
//In PhxPhush.kt
/**
* Triggers an event to be sent through the Channel
*/
fun trigger(status: String, payload: Payload) {
val mutPayload = payload.toMutableMap()
mutPayload["status"] = status
refEvent?.let {
//ref, topic, event, payload
val message = PhxMessage(it, "", "", mutPayload)
this.channel.trigger(message)
}
}
//In PhxChannel.kt
/**
* Triggers an event to the correct event binding created by `channel.on("event")
*
* @param message: Message that was received that will be sent to the correct binding
*/
fun trigger(message: PhxMessage) {
val handledMessage = onMessage(message)
//the event here is the empty string. The binding was made for 'chan_reply_8' event.
this.bindings[message.event]?.forEach { it.second(handledMessage) }
}
I think if the timeout trigger message was PhxMessage(it, "", refEvent, mutPayload) then things would work as intended. I can open a pull request with a proposed fix and some tests in the next day or two. I wasn't sure what the intended behavior was until your comment.
from javaphoenixclient.
Resolved in 0.1.8
from javaphoenixclient.
Related Issues (20)
- NPE in trigger() HOT 4
- Question about the heartbeat HOT 6
- Websocket is automatically reconnected event when intentionally closed HOT 2
- Lots of Timers created HOT 2
- ReconnectAfterMs is too big HOT 1
- Downgrade OKhttp to 3.12.2 HOT 1
- Heartbeat seems to be sent only once (instead of every x seconds) HOT 2
- Reconnection strategy documentation HOT 8
- Decoding message payloads HOT 2
- ConcurrentModificationException crash HOT 3
- java.util.ConcurrentModificationException HOT 4
- JSON serialization defaults modify property names HOT 2
- jcenter shutdown - February 2022 HOT 3
- Message.payload marked as non-nullable but can be null HOT 7
- Tries to reconnect with invalid token HOT 3
- Leaving channel causes timeout HOT 5
- `unmatched topic` after reconnect HOT 1
- Issue with AGP v8.0.0 R8 minification HOT 1
- Release 1.1.3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javaphoenixclient.