|
1 | | -using System; |
| 1 | +using System; |
2 | 2 | using System.Buffers; |
3 | 3 | using System.Collections.Concurrent; |
4 | 4 | using System.Collections.Generic; |
@@ -85,7 +85,7 @@ public async Task<IRSocketChannel> RequestChannel(IRSocketStream stream, ReadOnl |
85 | 85 | return channel; |
86 | 86 | } |
87 | 87 |
|
88 | | - protected class Channel : IRSocketChannel //TODO hmmm... |
| 88 | + protected class Channel : IRSocketChannel //TODO hmmm... |
89 | 89 | { |
90 | 90 | readonly RSocket Socket; |
91 | 91 | readonly int Stream; |
@@ -219,37 +219,38 @@ async Task Stream(int stream) |
219 | 219 | // IAsyncEnumerable<(ReadOnlySequence<byte> data, ReadOnlySequence<byte> metadata)> Outgoing)> |
220 | 220 | // Channeler { get; set; } = (request, incoming) => throw new NotImplementedException(); |
221 | 221 |
|
222 | | - //void IRSocketProtocol.RequestChannel(in RSocketProtocol.RequestChannel message, ReadOnlySequence<byte> metadata, ReadOnlySequence<byte> data) |
223 | | - //{ |
224 | | - // Channel(message.Stream).Start(); |
225 | | - |
226 | | - // //new Receiver<bool>() |
227 | | - |
228 | | - // //new Receiver<bool>(stream => RequestFireAndForget(stream, data, metadata), _ => true).ExecuteAsync(result: true); |
229 | | - // //var id = StreamDispatch(stream); |
230 | | - |
231 | | - // async Task Channel(int stream) |
232 | | - // { |
233 | | - // var (Incoming, Outoing) = Channeler((data, metadata)); //TODO Handle Errors. |
234 | | - |
235 | | - |
236 | | - // using (observable.Subscribe()) |
237 | | - // { |
238 | | - // var enumerator = source.GetAsyncEnumerator(); |
239 | | - // try |
240 | | - // { |
241 | | - // while (await enumerator.MoveNextAsync()) |
242 | | - // { |
243 | | - // var (Data, Metadata) = enumerator.Current; |
244 | | - // new RSocketProtocol.Payload(stream, Data, Metadata, next: true).Write(Transport.Output, Data, Metadata); |
245 | | - // await Transport.Output.FlushAsync(); |
246 | | - // } |
247 | | - // new RSocketProtocol.Payload(stream, complete: true).Write(Transport.Output); |
248 | | - // await Transport.Output.FlushAsync(); |
249 | | - // } |
250 | | - // finally { await enumerator.DisposeAsync(); } |
251 | | - // } |
252 | | - // } |
253 | | - //} |
| 222 | + void IRSocketProtocol.RequestChannel(in RSocketProtocol.RequestChannel message, ReadOnlySequence<byte> metadata, ReadOnlySequence<byte> data) |
| 223 | + { |
| 224 | + throw new NotImplementedException(); |
| 225 | + // Channel(message.Stream).Start(); |
| 226 | + |
| 227 | + // //new Receiver<bool>() |
| 228 | + |
| 229 | + // //new Receiver<bool>(stream => RequestFireAndForget(stream, data, metadata), _ => true).ExecuteAsync(result: true); |
| 230 | + // //var id = StreamDispatch(stream); |
| 231 | + |
| 232 | + // async Task Channel(int stream) |
| 233 | + // { |
| 234 | + // var (Incoming, Outoing) = Channeler((data, metadata)); //TODO Handle Errors. |
| 235 | + |
| 236 | + |
| 237 | + // using (observable.Subscribe()) |
| 238 | + // { |
| 239 | + // var enumerator = source.GetAsyncEnumerator(); |
| 240 | + // try |
| 241 | + // { |
| 242 | + // while (await enumerator.MoveNextAsync()) |
| 243 | + // { |
| 244 | + // var (Data, Metadata) = enumerator.Current; |
| 245 | + // new RSocketProtocol.Payload(stream, Data, Metadata, next: true).Write(Transport.Output, Data, Metadata); |
| 246 | + // await Transport.Output.FlushAsync(); |
| 247 | + // } |
| 248 | + // new RSocketProtocol.Payload(stream, complete: true).Write(Transport.Output); |
| 249 | + // await Transport.Output.FlushAsync(); |
| 250 | + // } |
| 251 | + // finally { await enumerator.DisposeAsync(); } |
| 252 | + // } |
| 253 | + // } |
| 254 | + } |
254 | 255 | } |
255 | 256 | } |
0 commit comments