JsonTextWriter.CloseAsync Method (original) (raw)

Json.NET JsonTextWriterCloseAsync Method

Asynchronously closes this writer. If CloseOutput is set to true, the destination is also closed.

Namespace: Newtonsoft.Json
Assembly: Newtonsoft.Json (in Newtonsoft.Json.dll) Version: 12.0.1+509643a8952ce731e0207710c429ad6e67dc43db

Syntax

public override Task CloseAsync( CancellationToken cancellationToken = null )

Parameters

cancellationToken (Optional)

Type: System.ThreadingCancellationToken
The token to monitor for cancellation requests. The default value is None.

Return Value

Type: Task
A Task that represents the asynchronous operation.

Remarks

Derived classes must override this method to get asynchronous behaviour. Otherwise it will execute synchronously, returning an already-completed task.

See Also

Reference