Expected Behavior
client -> .requestChannel
server -> receives .requestChannel
server -> sends message 1
client -> receives message 1
client -> sends message 2
server -> receives message 2
Actual Behavior
client -> .requestChannel
client -> sends message 1
server -> receives .requestChannel
Possible Solution
This looks intentional, there is some extra logic to do this in the code but I don't know why it is done this way. Receiving message before sending them sounds like a perfectly valid use case for me.
|
const [firstValueObservable, restValuestObservable] = partition( |
|
datas.pipe( |
|
share({ |
|
connector: () => new Subject(), |
|
resetOnRefCountZero: true, |
|
}) |
|
), |
|
(_value, index) => index === 0 |
|
); |
|
|
|
return ( |
|
rsocket: RSocket, |
|
metadata: Map<string | number | WellKnownMimeType, Buffer> |
|
) => |
|
firstValueObservable.pipe( |
|
take(1), |
|
concatMap( |
|
(firstValue) => |
|
new Observer2BufferingSubscriberToPublisher2PrefetchingObservable( |
|
( |
|
s: OnTerminalSubscriber & |
|
OnNextSubscriber & |
|
OnExtensionSubscriber & |
|
Requestable & |
|
Cancellable |
|
) => |
|
rsocket.requestChannel( |
Why is this done? Wouldnt be better to subscribe right away, even if there is no initial payload?
"rsocket-adapter-rxjs": "1.0.0-alpha.2",
"rsocket-core": "1.0.0-alpha.1",
Expected Behavior
client -> .requestChannel
server -> receives .requestChannel
server -> sends message 1
client -> receives message 1
client -> sends message 2
server -> receives message 2
Actual Behavior
client -> .requestChannel
client -> sends message 1
server -> receives .requestChannel
Possible Solution
This looks intentional, there is some extra logic to do this in the code but I don't know why it is done this way. Receiving message before sending them sounds like a perfectly valid use case for me.
rsocket-js/packages/rsocket-adapter-rxjs/src/Requesters.ts
Lines 133 to 159 in c6d6c47
Why is this done? Wouldnt be better to subscribe right away, even if there is no initial payload?