public async Task GetMultipleResultViaPbc(IRiakEndPointContext riakEndPointContext, Func <RiakPbcSocket, Task> useFun) { if (_disposing) { throw new RiakException((uint)ResultCode.ShuttingDown, "System currently shutting down", true); } if (riakEndPointContext.Node == null) { riakEndPointContext.Node = _loadBalancer.SelectNode(); if (riakEndPointContext.Node == null) { throw new RiakException((uint)ResultCode.ClusterOffline, "Unable to access functioning Riak node", true); } } if (riakEndPointContext.Socket == null) { riakEndPointContext.Socket = await riakEndPointContext.Node.CreateSocket(); } try { await riakEndPointContext.Node.GetMultipleResultViaPbc(riakEndPointContext.Socket, useFun).ConfigureAwait(false); } catch (RiakException riakException) { if (riakException.NodeOffline) { DeactivateNode(riakEndPointContext.Node); } throw; } }
public async Task GetSingleResultViaPbc(IRiakEndPointContext riakEndPointContext, Func <RiakPbcSocket, Task> useFun) { if (_disposing) { throw new RiakException((uint)ResultCode.ShuttingDown, "System currently shutting down", true); } if (riakEndPointContext.Node == null) { riakEndPointContext.Node = _node; } if (riakEndPointContext.Socket == null) { riakEndPointContext.Socket = await riakEndPointContext.Node.CreateSocket(); } await riakEndPointContext.Node.GetSingleResultViaPbc(riakEndPointContext.Socket, useFun).ConfigureAwait(false); }
public async Task <TResult> GetSingleResultViaPbc <TResult>(IRiakEndPointContext riakEndPointContext, Func <RiakPbcSocket, Task <TResult> > useFun) { return(await _endPoint.GetSingleResultViaPbc(riakEndPointContext, useFun).ConfigureAwait(false)); }
public async Task GetMultipleResultViaPbc(IRiakEndPointContext riakEndPointContext, Func <RiakPbcSocket, Task> useFun) { await _endPoint.GetMultipleResultViaPbc(riakEndPointContext, useFun).ConfigureAwait(false); }
public RiakBatch(IRiakEndPoint endPoint) { _endPoint = endPoint; _endPointContext = new RiakEndPointContext(); }