/// <summary> /// Reads and removes a message from the queue. This method is thread-safe. /// </summary> /// <param name="readingDelegate">Custom delegate to read using message's stream.</param> /// <param name="parameter">Delegate parameter object.</param> /// <param name="timeout">Operation timeout.</param> /// <returns> /// ChannelStateOperationResult with ChannelState and OperationStatus.Completed, OperationStatus.QueueIsEmpty, OperationStatus.Timeout, OperationStatus.Cancelled, /// OperationStatus.DelegateFailed, OperationStatus.RequestedLengthIsGreaterThanLogicalAddressSpace, OperationStatus.RequestedLengthIsGreaterThanVirtualAddressSpace, /// or any OperationStatus returned by readingDelegate. /// </returns> public IAsyncOperation <ChannelStateOperationResult> ReadAsync(AsynchronousReadingDelegateWithParameterAndResult readingDelegate, object parameter, TimeSpan timeout) { return(AsyncInfo.Run(async cancellationToken => { return new ChannelStateOperationResult(await _internal.ReadAsync(DelegateHelper.Wrap(readingDelegate), parameter, cancellationToken, timeout)); })); }
/// <summary> /// Adds new message to the queue. This method is thread-safe. /// </summary> /// <param name="writingDelegate">Custom delegate to write using message's stream.</param> /// <param name="parameter">Delegate parameter object.</param> /// <param name="length"> /// Specifies how much memory will be allocated for new message. /// Delegate will receive a stream with capacity limited by this parameter, but it is not forced to use all allocated space. /// </param> /// <param name="timeout">Operation timeout.</param> /// <returns> /// ChannelStateOperationResult with ChannelState and OperationStatus.Completed, OperationStatus.Timeout, OperationStatus.Cancelled, /// OperationStatus.DelegateFailed, OperationStatus.RequestedLengthIsGreaterThanLogicalAddressSpace, /// OperationStatus.RequestedLengthIsGreaterThanVirtualAddressSpace, OperationStatus.OutOfSpace or any OperationStatus returned by writingDelegate /// </returns> public IAsyncOperation <ChannelStateOperationResult> WriteAsync(AsynchronousWritingDelegateWithParameterAndResult writingDelegate, object parameter, long length, TimeSpan timeout) { return(AsyncInfo.Run(async cancellationToken => { return new ChannelStateOperationResult(await _internal.WriteAsync(DelegateHelper.Wrap(writingDelegate), parameter, length, cancellationToken, timeout)); })); }
public IAsyncOperation <ChannelStateOperationResult> ReadAsync(AsynchronousReadingDelegateWithResult readingDelegate) { return(AsyncInfo.Run(async cancellationToken => { return new ChannelStateOperationResult(await _internal.ReadAsync(DelegateHelper.Wrap(readingDelegate), null, cancellationToken, Timeout.InfiniteTimeSpan)); })); }
public IAsyncOperation <ChannelStateOperationResult> WriteAsync(AsynchronousWritingDelegateWithResult writingDelegate, long length) { return(AsyncInfo.Run(async cancellationToken => { return new ChannelStateOperationResult(await _internal.WriteAsync(DelegateHelper.Wrap(writingDelegate), null, length, cancellationToken, Timeout.InfiniteTimeSpan)); })); }
/// <summary> /// Reads and removes a message from the queue. This method is thread-safe. /// </summary> /// <param name="readingDelegate">Custom delegate to read using message's stream.</param> /// <param name="parameter">Delegate parameter object.</param> /// <param name="timeout">Operation timeout.</param> /// <returns> /// ChannelStateOperationResult with ChannelState and OperationStatus.Completed, OperationStatus.QueueIsEmpty, OperationStatus.Timeout, /// OperationStatus.DelegateFailed, OperationStatus.RequestedLengthIsGreaterThanLogicalAddressSpace, OperationStatus.RequestedLengthIsGreaterThanVirtualAddressSpace, /// or any OperationStatus returned by readingDelegate. /// </returns> public ChannelStateOperationResult Read(SynchronousReadingDelegateWithParameterAndResult readingDelegate, object parameter, TimeSpan timeout) { return(new ChannelStateOperationResult(_internal.Read(DelegateHelper.Wrap(readingDelegate), parameter, timeout))); }
public ChannelStateOperationResult Read(SynchronousReadingDelegateWithResult readingDelegate) { return(new ChannelStateOperationResult(_internal.Read(DelegateHelper.Wrap(readingDelegate)))); }
/// <summary> /// Reads and removes a message from the queue. This method is thread-safe. /// </summary> /// <param name="readingDelegate">Custom delegate to read using message's stream.</param> /// <param name="timeout">Operation timeout.</param> /// <returns> /// ChannelStateOperationResult with ChannelState and OperationStatus.Completed, OperationStatus.QueueIsEmpty, OperationStatus.Timeout, /// OperationStatus.DelegateFailed, OperationStatus.RequestedLengthIsGreaterThanLogicalAddressSpace, or OperationStatus.RequestedLengthIsGreaterThanVirtualAddressSpace. /// </returns> public ChannelStateOperationResult Read(SynchronousReadingDelegate readingDelegate, TimeSpan timeout) { return(new ChannelStateOperationResult(_internal.Read(DelegateHelper.Wrap(readingDelegate), timeout))); }
/// <summary> /// Adds new message to the queue. This method is thread-safe. /// </summary> /// <param name="writingDelegate">Custom delegate to write using message's stream.</param> /// <param name="parameter">Delegate parameter object.</param> /// <param name="length"> /// Specifies how much memory will be allocated for new message. /// Delegate will receive a stream with capacity limited by this parameter, but it is not forced to use all allocated space. /// </param> /// <param name="timeout">Operation timeout.</param> /// <returns> /// ChannelStateOperationResult with ChannelState and OperationStatus.Completed, OperationStatus.Timeout, /// OperationStatus.DelegateFailed, OperationStatus.RequestedLengthIsGreaterThanLogicalAddressSpace, /// OperationStatus.RequestedLengthIsGreaterThanVirtualAddressSpace, OperationStatus.OutOfSpace or any OperationStatus returned by writingDelegate. /// </returns> public ChannelStateOperationResult Write(SynchronousWritingDelegateWithParameterAndResult writingDelegate, object parameter, long length, TimeSpan timeout) { return(new ChannelStateOperationResult(_internal.Write(DelegateHelper.Wrap(writingDelegate), parameter, length, timeout))); }
public ChannelStateOperationResult Write(SynchronousWritingDelegateWithResult writingDelegate, long length) { return(new ChannelStateOperationResult(_internal.Write(DelegateHelper.Wrap(writingDelegate), length))); }
/// <summary> /// Adds new message to the queue. This method is thread-safe. /// </summary> /// <param name="writingDelegate">Custom delegate to write using message's stream.</param> /// <param name="length"> /// Specifies how much memory will be allocated for new message. /// Delegate will receive a stream with capacity limited by this parameter, but it is not forced to use all allocated space. /// </param> /// <param name="timeout">Operation timeout.</param> /// <returns> /// ChannelStateOperationResult with ChannelState and OperationStatus.Completed, OperationStatus.Timeout, /// OperationStatus.DelegateFailed, OperationStatus.RequestedLengthIsGreaterThanLogicalAddressSpace, /// OperationStatus.RequestedLengthIsGreaterThanVirtualAddressSpace or OperationStatus.OutOfSpace. /// </returns> public ChannelStateOperationResult Write(SynchronousWritingDelegate writingDelegate, long length, TimeSpan timeout) { return(new ChannelStateOperationResult(_internal.Write(DelegateHelper.Wrap(writingDelegate), length, timeout))); }