#cp.rx.RelaySubject

A Subject that provides new Observers with some or all of the most recently produced values upon reference.


#API Overview

Constructors - API calls which return an object, typically one that offers API methods

Methods - API calls which can only be made on an object returned by a constructor


#API Documentation

#Constructors

Signaturecp.rx.RelaySubject.create([n]) -> cp.rx.RelaySubject
TypeConstructor
DescriptionCreates a new ReplaySubject.
Parameters
  • bufferSize - The number of values to send to new subscribers. If nil, an infinite buffer is used (note that this could lead to memory issues).
Returns
  • The new `ReplaySubject.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/rx/ReplaySubject.lua line 18

#Methods

Signaturecp.rx.RelaySubject:onNext(...) -> nil
TypeMethod
DescriptionPushes zero or more values to the ReplaySubject. They will be broadcasted to all Observers.
Parameters
  • ... - The values to send.
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/rx/ReplaySubject.lua line 78

Signaturecp.rx.RelaySubject:subscribe([observer [, onError[, onCompleted]]]) -> cp.rx.Reference
TypeMethod
DescriptionCreates a new Observer and attaches it to the ReplaySubject. Immediately broadcasts the most recent contents of the buffer to the Observer.
Parameters
  • observer - Either an Observer, or a function to call when the ReplaySubject produces a value.
  • onError - A function to call when the ReplaySubject terminates due to an error.
  • onCompleted - A function to call when the ReplaySubject completes normally.
Returns
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/rx/ReplaySubject.lua line 40