loop = $loop; return $instance; } public function withConcurrency(Concurrency $concurrency): self { $instance = clone $this; $instance->concurrency = $concurrency; return $instance; } public function withCleanupInterval(Interval $interval): self { $instance = clone $this; $instance->cleanupInterval = $interval; return $instance; } public function build(): Context { return new Context( $this->loop ?? Factory::create(), $this->concurrency ?? Concurrency::unlimited(), $this->workers, $this->cleanupInterval ); } }