Closed aarlt closed 2 years ago
@aarlt you are using crossbar which is much more mature then this packages. So I bet, the issue is on my side. I havn't found the issue right away. I'll fix this during the week I hope!. Pretty busy atm.
@aarlt I just took a closer look to your issue report. Actually this is absolutly expected:
before publish: 1
after publish: 1
before publish: 2
received from <id>.push: '1'
after publish: 2
before publish: 3
received from <id>.push: '2'
after publish: 3
before publish: 4
received from <id>.push: '3'
after publish: 4
The received from <id>.push: '3'
is not awaited but totally async.
await session2.publish(
'topic',
arguments: ['4'], options: PublishOptions(acknowledge: true));
only receives a published, but not a has been receivced by the subscriber
. So even if the await was satisfied, doesn't mean that the client has received the event. Returning the published
is much faster then sending an event
from a publish
. There is almost no way that your expected result will happen. The only way to achieve this is to add a stream yourself, that is fed with the event
you receive in your subscriber and await it.
It looks like that there is something strange with
Session.publish
and/orSession.subscribe
. It might also be possible that something is off in my router implementation. Sorry, if this is the case.The following program
is generating the following output
It looks like that somehow the first publish is not directly triggering the subscription handler. Also the last event seem to not trigger the subscriber. It looks somehow like that a new publish just triggers the reception of an older event.
Expected output
Any ideas?