Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Latest commit

 

History

History
56 lines (34 loc) · 1.78 KB

ISubject.md

File metadata and controls

56 lines (34 loc) · 1.78 KB

com.industry.rx_epl.ISubject <>

ISubject is designed to be a subclass of IObservable, as such it has all of the methods on an IObservable. It also contains methods to allow values to be injected into the IObservable:

Methods

# .next(value: any) <>

Sends a value to all subscribers.

ISubject s := Subject.create();

ISubscription sub := s.subscribe(...); // Receives "abc" when .next(...) is called

s.next("abc");

# .error(error: any) <>

Sends an error to all subscribers. Errors will terminate the subject.

ISubject s := Subject.create();

ISubscription sub := s.subscribe(...); // Receives an error and terminates the subscription

s.error(com.apama.exceptions.Exception("Oh no!", "RuntimeException"));

# .complete() <>

Sends a complete to all subscribers. Complete will terminate the subject.

ISubject s := Subject.create();

ISubscription sub := s.subscribe(...); // Receives complete and terminates the subscription

s.complete();

# .asIObservable() returns IObservable<T> <>

Converts a subject to an IObservable.

ISubject s := Subject.create();

IObservable o := s.asIObservable();