Skip to content

RxScala Schedulers #1187

@headinthebox

Description

@headinthebox

I think it is a mistake to use Unit => Unit instead of () => Unit. Any takers, or I'll fix it later this week.

trait Worker extends Subscription {
  private [scala] val asJavaWorker: rx.Scheduler.Worker

  /**
   * Schedules a cancelable action to be executed in delayTime.
   */
  def schedule(action: Unit => Unit, delayTime: Duration): Subscription =
    this.asJavaWorker.schedule(
      new Action0 {
        override def call(): Unit = action()
      },
      delayTime.length,
      delayTime.unit)

  /**
   * Schedules a cancelable action to be executed immediately.
   */
  def schedule(action: Unit => Unit): Subscription = this.asJavaWorker.schedule(
    new Action0 {
      override def call(): Unit = action()
    }
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions