jypma opened a new pull request, #1802: URL: https://github.com/apache/pekko/pull/1802
This commit introduces Task, a data structure that represents a recipe, or program, for producing a value of type T (or failing with an exception). It is similar in semantics to RunnableGraph[T], but intended as first-class building block. It has the following properties: - A task can have resources associated to it, which are guaranteed to be released if the task is cancelled or fails - Tasks can be forked so multiple ones can run concurrently - Such forked tasks can be cancelled A Task can be created from a RunnableGraph which has a KillSwitch, by connecting a Source and a Sink through a KillSwitch, or by direct lambda functions. Open discussion points and TODOs (in order of highest architectural impact): - [ ] Current cancellation of a graph through `KillSwitch` doesn't communicate back a trigger when the graph is actually done cancelling. It would be very nice to incorporate that. - [ ] I've currently stuffed it inside the `stream` module, but it should probably have its own. - [ ] We need to add resource safety (by means of a new `TaskDef`: `case class FinallyDef[T](base: TaskDef[T], cleanup: TaskDef[_]`), which can then guarantee cleanup even under cancellation signals. - [ ] Add many more combinators (plain `zip`, `race`, ...) - [ ] Scala DSL Fixes #1801 . -- 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: notifications-unsubscr...@pekko.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For additional commands, e-mail: notifications-h...@pekko.apache.org