Skip to content

[Healtcheck] Remove tolerance dependency #5

@shouze

Description

@shouze

Actual TcpHealthcheck constructor is made like that:

public function __construct(float $initialExponent, float $step, float $maxExecutionTime, LoggerInterface $logger = null)

... and later on we build from the inside this kind of retry operation by using Tolerance:

$runner = new RetryOperationRunner(
new CallbackOperationRunner(),
new ExponentialBackOff(
new Timeout(new SleepWaiter(), $this->maxExecutionTime),
$this->initialExponent,
$this->step
)
);

Would be great to have that Tolerance part:

  • optional we can want to make a single healthcheck
  • external to this TcpHealthcheck class... thus removing Tolerance requirement in composer.json

That said... the best way probably is to inject a TcpClient that will be able to be decorated at will by some Tolerance operation.

WDYT @ubirak/core?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions