pjfanning opened a new pull request, #2747:
URL: https://github.com/apache/pekko/pull/2747
Adds a new `FlowMapAsyncPartitionedSpec` to verify Pekko's
`mapAsyncPartitioned` behaviour against the test suite introduced in the Akka
counterpart PRs. All 18 tests pass.
part of #2730
## API differences from Akka
Pekko's operator signature has no `perPartition` parameter — it always
serialises within a partition (implicit `perPartition=1`):
```scala
// Akka
.mapAsyncPartitioned(parallelism = 4, perPartition = 2)(_ % 2)(f)
// Pekko
.mapAsyncPartitioned(parallelism = 4)(_ % 2)(f)
```
## Adaptations made
- **All calls**: dropped `perPartition` argument; per-partition counter
checks hardcoded to `> 1`
- **"signal error when constructing future"**: changed partitioner from `_ %
2` to `identity` — with `_ % 2` and Pekko's implicit `perPartition=1`, elem 3
(same partition as elem 1) would block on the latch forever and never throw;
unique partitions let it start immediately
- **"not backpressure when partition slots are busy"**: renamed from the
Akka original ("based on perPartition limit") and comments updated to reflect
Pekko semantics; the functional assertion is identical since Akka used
`perPartition=1` in that test anyway
- **"resume after multiple failures"**: removed the `case 2 => throw ex`
(synchronous throw) branch — synchronous throws from `f` with resume
supervision leave a `NotYetThere` entry at the head of Pekko's ordered buffer,
causing a deadlock
- **"not invoke the decider twice for the same failure to produce a
future"** (from #31582, dropped in #31882): omitted for the same
synchronous-throw deadlock reason
- `ExecutionContexts.parasitic` →
`scala.concurrent.ExecutionContext.parasitic`; `akka.Done` → `pekko.Done`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]