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

Latest commit

 

History

History
27 lines (17 loc) · 1023 Bytes

ReplaySubject.md

File metadata and controls

27 lines (17 loc) · 1023 Bytes

com.industry.rx_epl.ReplaySubject <>

A subject that allows values to be sent to all subscribers. Late subscribers will receive some or all of the messages that they have missed.

Constructors

# static .create(count: integer) returns ISubject <>

Creates a new ReplaySubject. It will store the last count values and replay them to any new subscribers.

ISubject s := ReplaySubject.create(2);

ISubscription sub1 := s.subscribe(...);
s.next("Value1"); // Output (from sub1): "Value1"
s.next("Value2"); // Output (from sub1): "Value2"
s.next("Value3"); // Output (from sub1): "Value3"

// Late subscription
ISubscription sub2 := s.subscribe(...); // Output (from sub2): "Value2", "Value3"

s.next("Value4"); // Output (from sub1 and sub2): "Value4"

s.complete();