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

FGasper / p5-Promise-XS / 24113385519
88%

Build:
DEFAULT BRANCH: master
Ran 08 Apr 2026 01:51AM UTC
Jobs 1
Files 6
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

08 Apr 2026 01:50AM UTC coverage: 87.711% (+3.0%) from 84.755%
24113385519

push

github

web-flow
Reimplement all method in XS (#12)

## Summary

  Implement `all()` in XS (C), replacing the previous pure-Perl implementation.

  ## Motivation

  The old Perl implementation chained `.then()` calls sequentially:

  ```perl
  $all_done = $all_done->then(sub {
      @results = @_;
      return $p;
  })->then(sub { (@results, [@_]) });
  ```

  This meant promise N was not awaited until promise N−1 had already resolved —
  contrary to Promise/A+ semantics. The new XS implementation attaches callbacks
  to all input promises independently, giving true parallel waiting.

  ## Changes

  - **`XS.xs`**: Add `XSPR_CALLBACK_ALL` callback type and `pxs_all_state_t` shared state. Each input promise gets its own callback; when all resolve the output promise is resolved with an
   array-ref per input. The first rejection short-circuits and propagates to the output promise; subsequent rejections are silently suppressed (their `rejection_should_warn` flag is
  cleared) so only one unhandled-rejection warning is emitted. Exception safety during initialisation is provided by `SAVEDESTRUCTOR_X` guards that free partially-constructed state on
  croak/die.
  - **`lib/Promise/XS/Promise.pm`**: Remove the now-superseded Perl `all()`.
  - **`t/unhandled_rejection.t`**: Add regression tests confirming that a caught `all()` rejection produces no warnings, and an uncaught one produces exactly one warning (from the output
  promise, not from each input).

  ## Behavioural notes for users

  | Aspect | Before | After |
  |--------|--------|-------|
  | Execution model | Sequential (chained `.then()`) | Parallel (independent callbacks) |
  | Return value format | `([v1…], [v2…], …)` | Same |
  | Unhandled rejection warnings | Could leak multiple warnings | Exactly one warning from output |
  | Performance | O(N) Perl call overhead | XS |

  The return-value format is unchanged. Code that accidentally relied on sequential execution (e.g. ordering side-effects through `all()`) sh... (continued)

63 of 63 new or added lines in 1 file covered. (100.0%)

728 of 830 relevant lines covered (87.71%)

548.86 hits per line

Jobs
ID Job ID Ran Files Coverage
1 24113385519.1 08 Apr 2026 01:51AM UTC 6
87.71
GitHub Action Run
Source Files on build 24113385519
  • Tree
  • List 6
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 627857a5 on github
  • Prev Build on master (#24056082859)
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