+
Skip to content

Redesign Completes<T> so it decouples composition and execution time #16

@kmruiz

Description

@kmruiz

We realised after a long conversation that Completes<T> right now has an important issue that needs to be tackled: a Completes<T> pipeline can be run during the composition fase, because it runs potentially in different threads.

Our new proposal is to actually rework how Completes<T> works so it can be simplified, more efficient and easier to change. The design decisions that we want to take:

  • Completes<T> composition will only be done in a single thread.
  • Completes<T> execution will be lazy, it will be only run when there is an outcome and it's marked as ready.
  • Completes<T> will be executed in a threadpool only if it's marked as ready and has an outcome.
  • Completes<T> will separate two responsibilities: who is sending the outcome to the chain, and how the chain processes the outcome. For example, you can have a SingleSource<T> that will only emit a single outcome to the whole chain, and you can have also a RepeatableSource<T> that can emit up to N elements. We can build more sources from CompletableFuture<T> and other async components.
  • Timeouts will act as gateways. We are not measuring the time we spend processing a step in the chain, but the deadline from an outcome to pass through the timeout gateway. So it will measure the time between outcomes.

Opinions and feedback are really appreciated.

It's also a good opportunity to work on the following issues and solve them:

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载