• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

excaliburjs / Excalibur / 10223822806
89%

Build:
DEFAULT BRANCH: main
Ran 03 Aug 2024 12:44AM UTC
Jobs 1
Files 220
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Aug 2024 12:40AM UTC coverage: 90.122% (+0.06%) from 90.064%
10223822806

push

github

web-flow
feat: Coroutine instances (#3154)

This PR gives users greater flexibility with Excalibur Coroutines!
* Optionally ask coroutines not to start immediately
  ```typescript
  ex.coroutine(function* () { .. }, { autostart: false });
  ```
* New `CoroutineInstance` is returned that is also awaitable
  ```typescript
  export interface CoroutineOptions {
    timing?: ScheduledCallbackTiming;
    autostart?: boolean;
  }
   
  export interface CoroutineInstance extends PromiseLike<void> {
    isRunning(): boolean;
    isComplete(): boolean;
    done: Promise<void>;
    generator: Generator<CoroutineInstance | number | Promise<any> | undefined, void, number>;
    start: () => CoroutineInstance;
    cancel: () => void;
    then: Thenable;
    [Symbol.iterator]: () => Generator<CoroutineInstance | number | Promise<any> | undefined, void, number>;
  }
  ```
  ```typescript
  const co = ex.coroutine(function* () { 
    yield 100;
  });

  await co; // wait for coroutine to finish
  ```

* `start()`/`cancel()`coroutines 

  ```typescript
  const co = ex.coroutine(function* () { 
    yield 100;
  });

  co.start();
  co.cancel();

  await co;
  ```

* nested coroutines! (Nested coroutines do not start running, they are run with their parent)
   
  ```typescript
  const result = ex.coroutine(function* () {
      yield 100;
      yield* ex.coroutine(function* () {
        const elapsed = yield 99;
      });
      yield 100;
  });
  ```

5632 of 7190 branches covered (78.33%)

39 of 39 new or added lines in 2 files covered. (100.0%)

12509 of 13880 relevant lines covered (90.12%)

24904.76 hits per line

Jobs
ID Job ID Ran Files Coverage
1 10223822806.1 03 Aug 2024 12:44AM UTC 0
90.12
GitHub Action Run
Source Files on build 10223822806
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #10223822806
  • 98ea1672 on github
  • Prev Build on main (#10219536219)
  • Next Build on main (#10223952375)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc