Header menu logo FSharp.Core

CommonExtensions Module

A module of extension members providing asynchronous operations for some basic CLI types related to concurrency and I/O.

Type extensions

Type extension Description

this.Add

Full Usage: this.Add

Parameters:
    callback : 'T -> unit - The function to be called for each observation.

Permanently connects a listener function to the observable. The listener will be invoked for each observation.

Extended Type: IObservable

callback : 'T -> unit

The function to be called for each observation.

this.AsyncRead

Full Usage: this.AsyncRead

Parameters:
    buffer : byte array - The buffer to read into.
    ?offset : int - An optional offset as a number of bytes in the stream.
    ?count : int - An optional number of bytes to read from the stream.

Returns: Async<int> An asynchronous computation that will read from the stream into the given buffer.

Returns an asynchronous computation that will read from the stream into the given buffer.

Extended Type: Stream

buffer : byte array

The buffer to read into.

?offset : int

An optional offset as a number of bytes in the stream.

?count : int

An optional number of bytes to read from the stream.

Returns: Async<int>

An asynchronous computation that will read from the stream into the given buffer.

ArgumentException Thrown when the sum of offset and count is longer than the buffer length.
ArgumentOutOfRangeException Thrown when offset or count is negative.

this.AsyncRead

Full Usage: this.AsyncRead

Parameters:
    count : int - The number of bytes to read.

Returns: Async<byte array> An asynchronous computation that returns the read byte array when run.

Returns an asynchronous computation that will read the given number of bytes from the stream.

Extended Type: Stream

count : int

The number of bytes to read.

Returns: Async<byte array>

An asynchronous computation that returns the read byte array when run.

this.AsyncWrite

Full Usage: this.AsyncWrite

Parameters:
    buffer : byte array - The buffer to write from.
    ?offset : int - An optional offset as a number of bytes in the stream.
    ?count : int - An optional number of bytes to write to the stream.

Returns: Async<unit> An asynchronous computation that will write the given bytes to the stream.

Returns an asynchronous computation that will write the given bytes to the stream.

Extended Type: Stream

buffer : byte array

The buffer to write from.

?offset : int

An optional offset as a number of bytes in the stream.

?count : int

An optional number of bytes to write to the stream.

Returns: Async<unit>

An asynchronous computation that will write the given bytes to the stream.

ArgumentException Thrown when the sum of offset and count is longer than the buffer length.
ArgumentOutOfRangeException Thrown when offset or count is negative.

this.Subscribe

Full Usage: this.Subscribe

Parameters:
    callback : 'T -> unit - The function to be called for each observation.

Returns: IDisposable An object that will remove the listener if disposed.

Connects a listener function to the observable. The listener will be invoked for each observation. The listener can be removed by calling Dispose on the returned IDisposable object.

Extended Type: IObservable

callback : 'T -> unit

The function to be called for each observation.

Returns: IDisposable

An object that will remove the listener if disposed.

Type something to start searching.