Skip to content

Observable class

Defined in

Namespace: System.Reactive.Linq Assembly: System.Reactive.dll Full name: System.Reactive.Linq.Observable Modifiers: public static

Summary

        Provides a set of static methods for writing in-memory queries over observable sequences.
        

Applies to

netstandard2.0

Methods

NameSummary
static AggregateApplies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial...
static AllDetermines whether all elements of an observable sequence satisfy a condition.
static AnyDetermines whether an observable sequence contains any elements.
static AverageComputes the average of an observable sequence of Double values.
static ContainsDetermines whether an observable sequence contains a specified element by using the default equality comparer.
static CountReturns an observable sequence containing an Int32 that represents the total number of elements in an observable sequence.
static ElementAtReturns the element at a specified index in a sequence.
static ElementAtOrDefaultReturns the element at a specified index in a sequence or a default value if the index is out of range.
static FirstAsyncReturns the first element of an observable sequence.
static FirstOrDefaultAsyncReturns the first element of an observable sequence, or a default value if no such element exists.
static IsEmptyDetermines whether an observable sequence is empty.
static LastAsyncReturns the last element of an observable sequence.
static LastOrDefaultAsyncReturns the last element of an observable sequence, or a default value if no such element exists.
static LongCountReturns an observable sequence containing an Int64 that represents the total number of elements in an observable sequence.
static MaxReturns the maximum element in an observable sequence.
static MaxByReturns the elements in an observable sequence with the maximum key value.
static MinReturns the minimum element in an observable sequence.
static MinByReturns the elements in an observable sequence with the minimum key value.
static SequenceEqualDetermines whether two sequences are equal by comparing the elements pairwise.
static SingleAsyncReturns the only element of an observable sequence, and reports an exception if there is not exactly one element in the observable sequence.
static SingleOrDefaultAsyncReturns the only element of an observable sequence, or a default value if the observable sequence is empty; this method reports an exception if there is more than one element in the observable...
static SumComputes the sum of a sequence of Double values.
static ToArrayCreates an array from an observable sequence.
static ToDictionaryCreates a dictionary from an observable sequence according to a specified key selector function.
static ToListCreates a list from an observable sequence.
static ToLookupCreates a lookup from an observable sequence according to a specified key selector function.
static FromAsyncPatternConverts a Begin/End invoke function pair into an asynchronous function.
static StartInvokes the specified function asynchronously, surfacing the result through an observable sequence.
static StartAsyncInvokes the asynchronous function, surfacing the result through an observable sequence.
static FromAsyncConverts an asynchronous function into an observable sequence. Each subscription to the resulting sequence causes the function to be started.
static ToAsyncConverts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function.
static GetAwaiterGets an awaiter that returns the last value of the observable sequence or throws an exception if the sequence is empty. This operation subscribes to the observable sequence, making it...
static RunAsyncGets an awaiter that returns the last value of the observable sequence or throws an exception if the sequence is empty. This operation subscribes to the observable sequence, making it...
static MulticastMulticasts the source sequence notifications through the specified subject to the resulting connectable observable. Upon connection of the connectable observable, the subject is...
static PublishReturns a connectable observable sequence that shares a single subscription to the underlying sequence. This operator is a specialization of Multicast using a regular...
static PublishLastReturns a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification. This operator is a specialization of Multicast using a...
static RefCountReturns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence.
static AutoConnectAutomatically connect the upstream IConnectableObservable at most once when the specified number of IObservers have subscribed to this IObservable.
static ReplayReturns a connectable observable sequence that shares a single subscription to the underlying sequence replaying all notifications. This operator is a specialization of Multicast using a...
static ChunkifyProduces an enumerable sequence of consecutive (possibly empty) chunks of the source sequence.
static CollectProduces an enumerable sequence that returns elements collected/aggregated from the source sequence between consecutive iterations.
static FirstReturns the first element of an observable sequence.
static FirstOrDefaultReturns the first element of an observable sequence, or a default value if no such element exists.
static ForEachInvokes an action for each element in the observable sequence, and blocks until the sequence is terminated.
static GetEnumeratorReturns an enumerator that enumerates all values of the observable sequence.
static LastReturns the last element of an observable sequence.
static LastOrDefaultReturns the last element of an observable sequence, or a default value if no such element exists.
static LatestReturns an enumerable sequence whose enumeration returns the latest observed element in the source observable sequence. Enumerators on the resulting sequence will never produce the same...
static MostRecentReturns an enumerable sequence whose enumeration returns the most recently observed element in the source observable sequence, using the specified initial value in case no element has been sampled...
static NextReturns an enumerable sequence whose enumeration blocks until the next element in the source observable sequence becomes available. Enumerators on the resulting sequence will block until...
static SingleReturns the only element of an observable sequence, and throws an exception if there is not exactly one element in the observable sequence.
static SingleOrDefaultReturns the only element of an observable sequence, or a default value if the observable sequence is empty; this method throws an exception if there is more than one element in the observable...
static WaitWaits for the observable sequence to complete and returns the last element of the sequence. If the sequence terminates with an OnError notification, the exception is thrown.
static ObserveOnWraps the source sequence in order to run its observer callbacks on the specified scheduler.
static SubscribeOnWraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; see the remarks section for more...
static SynchronizeSynchronizes the observable sequence such that observer notifications cannot be delivered concurrently. This overload is useful to "fix" an observable sequence that exhibits concurrent...
static SubscribeSubscribes an observer to an enumerable sequence.
static ToEnumerableConverts an observable sequence to an enumerable sequence.
static ToEventExposes an observable sequence as an object with an Action-based .NET event.
static ToEventPatternExposes an observable sequence as an object with a .NET event, conforming to the standard .NET event pattern.
static ToObservableConverts an enumerable sequence to an observable sequence.
static CreateCreates an observable sequence from a specified Subscribe method implementation.
static DeferReturns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
static DeferAsyncReturns an observable sequence that starts the specified cancellable asynchronous factory function whenever a new observer subscribes. The CancellationToken passed to the asynchronous...
static EmptyReturns an empty observable sequence.
static GenerateGenerates an observable sequence by running a state-driven loop producing the sequence's elements.
static NeverReturns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
static RangeGenerates an observable sequence of integral numbers within a specified range.
static RepeatGenerates an observable sequence that repeats the given element infinitely.
static ReturnReturns an observable sequence that contains a single element.
static ThrowReturns an observable sequence that terminates with an exception.
static UsingConstructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
static FromEventPatternConverts a .NET event, conforming to the standard .NET event pattern based on EventHandler, to an observable sequence. Each event...
static FromEventConverts a .NET event to an observable sequence, using a conversion function to obtain the event delegate. Each event invocation is surfaced through an OnNext message in the resulting sequence. ...
static ForEachAsyncInvokes an action for each element in the observable sequence, and returns a Task object that will get signaled when the sequence terminates.
static CaseUses selector to determine which source in sources to return, choosing defaultSource if no match is found.
static DoWhileRepeats the given source as long as the specified condition holds, where the condition is evaluated after each repeated source completed.
static ForConcatenates the observable sequences obtained by running the resultSelector for each element in the given enumerable source.
static IfIf the specified condition evaluates true, select the thenSource sequence. Otherwise, select the elseSource sequence.
static WhileRepeats the given source as long as the specified condition holds, where the condition is evaluated before each repeated source is subscribed to.
static AndCreates a pattern that matches when both observable sequences have an available element.
static ThenMatches when the observable sequence has an available element and projects the element by invoking the selector function.
static WhenJoins together the results from several patterns.
static CombineLatestMerges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element.
static AmbPropagates the observable sequence that reacts first.
static BufferProjects each element of an observable sequence into consecutive non-overlapping buffers.
static CatchContinues an observable sequence that is terminated by an exception of the specified type with the observable sequence produced by the handler.
static ConcatConcatenates the second observable sequence to the first observable sequence upon successful termination of the first.
static MergeMerges elements from all inner observable sequences into a single observable sequence.
static OnErrorResumeNextConcatenates the second observable sequence to the first observable sequence upon successful or exceptional termination of the first.
static SkipUntilReturns the elements from the source observable sequence only after the other observable sequence produces an element. Starting from Rx.NET 4.0, this will subscribe to other before subscribing to...
static SwitchTransforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. Each time a new inner...
static TakeUntilReturns the elements from the source observable sequence until the other observable sequence produces an element.
static WindowProjects each element of an observable sequence into consecutive non-overlapping windows.
static WithLatestFromMerges two observable sequences into one observable sequence by combining each element from the first source with the latest element from the second source, if any. Starting from Rx.NET 4.0, this...
static ZipMerges two observable sequences into one observable sequence by combining their elements in a pairwise fashion.
static AppendAppend a value to an observable sequence.
static AsObservableHides the identity of an observable sequence.
static ResetExceptionDispatchStatePropagates all messages, but if source produces an error, this updates the dispatch state of the Exception to reflect the current...
static DematerializeDematerializes the explicit notification values of an observable sequence as implicit notifications.
static DistinctUntilChangedReturns an observable sequence that contains only distinct contiguous elements.
static DoInvokes an action for each element in the observable sequence, and propagates all observer messages through the result sequence. This method can be used for debugging, logging, etc. of...
static FinallyInvokes a specified action after the source observable sequence terminates gracefully or exceptionally.
static IgnoreElementsIgnores all elements in an observable sequence leaving only the termination messages.
static MaterializeMaterializes the implicit notifications of an observable sequence as explicit notification values.
static PrependPrepend a value to an observable sequence.
static RepeatWhenRepeatedly resubscribes to the source observable after a normal completion and when the observable returned by a handler produces an arbitrary item.
static RetryRepeats the source observable sequence until it successfully terminates.
static RetryWhenRetries (resubscribes to) the source observable after a failure and when the observable returned by a handler produces an arbitrary item.
static ScanApplies an accumulator function over an observable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. For aggregation behavior with no...
static SkipLastBypasses a specified number of elements at the end of an observable sequence.
static StartWithPrepends a sequence of values to an observable sequence.
static TakeLastReturns a specified number of contiguous elements from the end of an observable sequence.
static TakeLastBufferReturns a list with the specified number of contiguous elements from the end of an observable sequence.
static CastConverts the elements of an observable sequence to the specified type.
static DefaultIfEmptyReturns the elements of the specified sequence or the type parameter's default value in a singleton sequence if the sequence is empty.
static DistinctReturns an observable sequence that contains only distinct elements.
static GroupByGroups the elements of an observable sequence according to a specified key selector function.
static GroupByUntilGroups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function. A duration...
static GroupJoinCorrelates the elements of two sequences based on overlapping durations, and groups the results.
static JoinCorrelates the elements of two sequences based on overlapping durations.
static OfTypeFilters the elements of an observable sequence based on the specified type.
static SelectProjects each element of an observable sequence into a new form.
static SelectManyProjects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
static SkipBypasses a specified number of elements in an observable sequence and then returns the remaining elements.
static SkipWhileBypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
static TakeReturns a specified number of contiguous elements from the start of an observable sequence.
static TakeWhileReturns elements from an observable sequence as long as a specified condition is true.
static WhereFilters the elements of an observable sequence based on a predicate.
static DelayTime shifts the observable sequence by the specified relative time duration. The relative time intervals between the values are preserved.
static DelaySubscriptionTime shifts the observable sequence by delaying the subscription with the specified relative time duration.
static IntervalReturns an observable sequence that produces a value after each period.
static SampleSamples the observable sequence at each interval. Upon each sampling tick, the latest element (if any) in the source sequence during the last sampling interval is sent to the resulting...
static ThrottleIgnores elements from an observable sequence which are followed by another element within a specified relative time duration.
static TimeIntervalRecords the time interval between consecutive elements in an observable sequence.
static TimeoutApplies a timeout policy for each element in the observable sequence. If the next element isn't received within the specified timeout duration starting from its predecessor, a...
static TimerReturns an observable sequence that produces a single value after the specified relative due time has elapsed.
static TimestampTimestamps each element in an observable sequence using the local system clock.
Inherited members