# 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

  • create

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

  • onNext
  • subscribe

# API Documentation

# Constructors

# create

Signature cp.rx.RelaySubject.create([n]) -> cp.rx.RelaySubject
Type Constructor
Description Creates 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.
Notes None
Examples None
Source src/extensions/cp/rx/ReplaySubject.lua line 18

# Methods

# onNext

Signature cp.rx.RelaySubject:onNext(...) -> nil
Type Method
Description Pushes zero or more values to the ReplaySubject. They will be broadcasted to all Observers.
Parameters
  • ... - The values to send.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/rx/ReplaySubject.lua line 78

# subscribe

Signature cp.rx.RelaySubject:subscribe([observer [, onError[, onCompleted]]]) -> cp.rx.Reference
Type Method
Description Creates 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
Notes None
Examples None
Source src/extensions/cp/rx/ReplaySubject.lua line 40