Options
All
  • Public
  • Public/Protected
  • All
Menu

A container for running coroutines.

remarks

this might be renamed "Timeline" in the future

Hierarchy

  • Coroutines

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private coroutines

coroutines: Iterator<any>[] = []

name

name: string

For debugging

Methods

start

  • start(coro: Iterator<any> | function): Iterator<any>
  • Schedules a coroutine for evaluation.

    Future calls to tick will run coro up to its next yield until it is completed.

    As a convenience if coro is a generator function and not a generator, it will be evaluated to produce a generator.

    function* coroutineFunction() { ... }
    let coro = new Coroutines()
    coro.start(coroutineFunction()) // this works
    coro.start(coroutineFunction)   // so does this

    Parameters

    • coro: Iterator<any> | function

      coroutine to start

    Returns Iterator<any>

stop

  • stop(coro: Iterator<any>): void
  • Stops a single coroutine

    Parameters

    • coro: Iterator<any>

      coroutine to stop

    Returns void

stopAll

  • stopAll(): void

tick

  • tick(): void
  • Runs all scheduled coroutines once.

    Each coroutine added with start will run up to its next yield statement. Finished coroutines are removed from the collection.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc