Exemple #1
0
        public IObservable <TResult> PbcRepeatRead <TResult>(IRiakEndPoint endPoint, Func <TResult, bool> repeatRead)
            where TResult : class, new()
        {
            var pbcStreamReadIterator = Observable.Create <TResult>(async observer =>
            {
                await endPoint.GetMultipleResultViaPbc(async socket =>
                {
                    try
                    {
                        TResult result;
                        do
                        {
                            result = await PbcRead <TResult>(socket).ConfigureAwait(false);
                            observer.OnNext(result);
                        } while (repeatRead(result));
                        observer.OnCompleted();
                    }
                    catch (Exception exception)
                    {
                        observer.OnError(exception);
                    }
                }).ConfigureAwait(false);
                return(Disposable.Empty);
            });

            return(pbcStreamReadIterator);
        }
Exemple #2
0
 public async Task GetMultipleResultViaPbc(Func <RiakPbcSocket, Task> useFun)
 {
     await _endPoint.GetMultipleResultViaPbc(_endPointContext, useFun).ConfigureAwait(false);
 }