Record Class BlockingScheduler

java.lang.Object
java.lang.Record
io.reactivex.rxjava4.schedulers.BlockingScheduler
Record Components:
bcts - the scheduler instance

public record BlockingScheduler(io.reactivex.rxjava4.internal.schedulers.BlockingCurrentThreadScheduler bcts) extends Record
Holds onto a blocking scheduler instance and provides access to its execute() method and a way to obtain a pure Scheduler instance to be used as parameter.
Since:
4.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockingScheduler(io.reactivex.rxjava4.internal.schedulers.BlockingCurrentThreadScheduler bcts)
    Creates an instance of a BlockingScheduler record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.reactivex.rxjava4.internal.schedulers.BlockingCurrentThreadScheduler
    Returns the value of the bcts record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    void
    Begin executing the blocking event loop without any initial action.
    void
    execute(Action action)
    Begin executing the blocking event loop with the given initial action (usually contain the rest of the 'main' method).
    final int
    Returns a hash code value for this object.
    Returns the Scheduler view to submit tasks to or use it as a parameter.
    void
    Shuts down the underlying blocking current thread scheduler
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BlockingScheduler

      public BlockingScheduler(io.reactivex.rxjava4.internal.schedulers.BlockingCurrentThreadScheduler bcts)
      Creates an instance of a BlockingScheduler record class.
      Parameters:
      bcts - the value for the bcts record component
  • Method Details

    • scheduler

      public Scheduler scheduler()
      Returns the Scheduler view to submit tasks to or use it as a parameter.
      Returns:
      the Scheduler view of the underlying blocking current thread scheduler.
    • execute

      public void execute()
      Begin executing the blocking event loop without any initial action.

      This method will block until the Scheduler.shutdown() is invoked.

      See Also:
    • execute

      public void execute(Action action)
      Begin executing the blocking event loop with the given initial action (usually contain the rest of the 'main' method).

      This method will block until the Scheduler.shutdown() is invoked.

      Parameters:
      action - the action to execute
    • shutdown

      public void shutdown()
      Shuts down the underlying blocking current thread scheduler
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • bcts

      public io.reactivex.rxjava4.internal.schedulers.BlockingCurrentThreadScheduler bcts()
      Returns the value of the bcts record component.
      Returns:
      the value of the bcts record component