public sealed class AsyncExchange<T> : IValueTaskSource<ReadLease<T>>,
IValueTaskSource
Public NotInheritable Class AsyncExchange(Of T)
Implements IValueTaskSource(Of ReadLease(Of T)), IValueTaskSource[<SealedAttribute>]
type AsyncExchange<'T> =
class
interface IValueTaskSource<ReadLease<'T>>
interface IValueTaskSource
end[缺少 "T:TouchSocket.Core.AsyncExchange`1" 的 <typeparam name="T"/> 文档]
| AsyncExchangeT | 初始化 AsyncExchangeT 类的一个新实例 |
| IsCompleted | 获取当前是否已完成(即已调用 Complete,且没有未消费数据和挂起的读写操作)。 |
| Complete | 标记当前交接已完成。调用后不再接受新的写入请求, 若当前没有未消费数据且有挂起的读取操作,则立即完成该读取操作。 |
| Equals | Determines whether the specified object is equal to the current object. (继承自 Object。) |
| GetHashCode | Serves as the default hash function. (继承自 Object。) |
| GetType | Gets the Type of the current instance. (继承自 Object。) |
| ReadAsync | 异步读取数据。如果当前有可用数据则立即返回,否则挂起等待数据写入或交接完成。 返回的 ReadLeaseT 需在读取后调用 Dispose 以释放资源并通知写端完成。 若已完成交接,则返回已完成的租约。 |
| Reset | 重置当前交接状态。仅在已完成且无未消费数据和挂起操作时可调用, 否则会抛出异常。重置后可重新开始新的交接流程。 |
| ToString | Returns a string that represents the current object. (继承自 Object。) |
| WriteAsync | 异步写入数据。如果当前有未消费数据或有挂起的写操作,则抛出异常; 否则将数据写入并挂起等待读取端消费,消费后写操作完成。 若已完成交接,则抛出异常。 |
| Map |
将源对象的属性映射到目标对象的属性中。
(由 Mapper 定义。) |
| Map |
将源对象映射到目标类型的实例。
(由 Mapper 定义。) |
| MapTTarget |
将源对象映射到指定目标类型的新实例。
(由 Mapper 定义。) |
| ToJsonString |
转换为Json
(由 SerializeConvert 定义。) |
| IValueTaskSourceGetResult | Gets the result of the IValueTaskSource. |
| IValueTaskSourceGetStatus | Gets the status of the current operation. |
| IValueTaskSourceOnCompleted | Schedules the continuation action for this IValueTaskSource. |
| IValueTaskSourceReadLeaseTGetResult | Gets the result of the IValueTaskSourceTResult. |
| IValueTaskSourceReadLeaseTGetStatus | Gets the status of the current operation. |
| IValueTaskSourceReadLeaseTOnCompleted | Schedules the continuation action for this IValueTaskSourceTResult. |