DataflowBlock.SendAsync 메서드

정의

오버로드

Name Description
SendAsync<TInput>(ITargetBlock<TInput>, TInput, CancellationToken)

대상 메시지 블록에 메시지를 비동기적으로 제공하여 연기할 수 있습니다.

SendAsync<TInput>(ITargetBlock<TInput>, TInput)

대상 메시지 블록에 메시지를 비동기적으로 제공하여 연기할 수 있습니다.

SendAsync<TInput>(ITargetBlock<TInput>, TInput, CancellationToken)

Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs

대상 메시지 블록에 메시지를 비동기적으로 제공하여 연기할 수 있습니다.

public:
generic <typename TInput>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<bool> ^ SendAsync(System::Threading::Tasks::Dataflow::ITargetBlock<TInput> ^ target, TInput item, System::Threading::CancellationToken cancellationToken);
public static System.Threading.Tasks.Task<bool> SendAsync<TInput>(this System.Threading.Tasks.Dataflow.ITargetBlock<TInput> target, TInput item, System.Threading.CancellationToken cancellationToken);
static member SendAsync : System.Threading.Tasks.Dataflow.ITargetBlock<'Input> * 'Input * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
<Extension()>
Public Function SendAsync(Of TInput) (target As ITargetBlock(Of TInput), item As TInput, cancellationToken As CancellationToken) As Task(Of Boolean)

형식 매개 변수

TInput

대상에 게시할 데이터의 형식을 지정합니다.

매개 변수

target
ITargetBlock<TInput>

데이터를 게시할 대상입니다.

item
TInput

대상에 제공되는 항목입니다.

cancellationToken
CancellationToken

보내기 작업의 취소를 요청할 취소 토큰입니다.

반품

비동기 보내기를 나타내는 A Task<TResult> 입니다. SendAsync를 호출하는 동안 대상이 제공된 요소를 수락하고 사용하는 경우 호출에서 돌아오면 결과가 Task<TResult> 완료되고 해당 속성이 Result true로 반환됩니다. 호출 중에 대상이 제공된 요소를 거절하는 경우 호출에서 반환되면 결과가 Task<TResult> 완료되고 해당 Result 속성은 false를 반환합니다. 대상이 제공된 요소를 연기하면 대상에서 요소를 사용하거나 해제할 때까지 요소가 버퍼링되며, 이때 메시지가 사용되었는지 여부를 나타내는 작업이 완료 Result 됩니다. 대상이 메시지를 사용하거나 해제하려고 시도하지 않으면 반환된 작업이 완료되지 않습니다.

대상에서 전송된 데이터를 성공적으로 소비하기 전에 취소가 요청되면 반환된 작업이 취소됨 상태로 완료되고 더 이상 대상에서 데이터를 사용할 수 없게 됩니다.

예외

target null(Visual Basic 없음)입니다.

취소 토큰이 취소되었습니다. 이 예외는 반환된 작업에 저장됩니다.

적용 대상

SendAsync<TInput>(ITargetBlock<TInput>, TInput)

Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs
Source:
DataflowBlock.cs

대상 메시지 블록에 메시지를 비동기적으로 제공하여 연기할 수 있습니다.

public:
generic <typename TInput>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<bool> ^ SendAsync(System::Threading::Tasks::Dataflow::ITargetBlock<TInput> ^ target, TInput item);
public static System.Threading.Tasks.Task<bool> SendAsync<TInput>(this System.Threading.Tasks.Dataflow.ITargetBlock<TInput> target, TInput item);
static member SendAsync : System.Threading.Tasks.Dataflow.ITargetBlock<'Input> * 'Input -> System.Threading.Tasks.Task<bool>
<Extension()>
Public Function SendAsync(Of TInput) (target As ITargetBlock(Of TInput), item As TInput) As Task(Of Boolean)

형식 매개 변수

TInput

대상에 게시할 데이터의 형식을 지정합니다.

매개 변수

target
ITargetBlock<TInput>

데이터를 게시할 대상입니다.

item
TInput

대상에 제공되는 항목입니다.

반품

비동기 보내기를 나타내는 A Task<TResult> 입니다. 대상이 호출 중에 제공된 요소를 수락하고 사용하는 경우 호출 SendAsync<TInput>(ITargetBlock<TInput>, TInput)에서 반환되면 결과가 Task<TResult> 완료되고 해당 속성이 Result 반환 true됩니다. 호출 중에 대상이 제공된 요소를 거절하는 경우 호출에서 반환되면 결과가 Task<TResult> 완료되고 해당 속성이 Result 반환 false됩니다. 대상이 제공된 요소를 연기하면 대상에서 요소를 사용하거나 해제할 때까지 요소가 버퍼링되며, 이때 메시지가 사용되었는지 여부를 나타내는 작업이 완료 Result 됩니다. 대상이 메시지를 사용하거나 해제하려고 시도하지 않으면 반환된 작업이 완료되지 않습니다.

예외

targetnull입니다.

적용 대상