Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [Unreleased]

### Added

- Internal `Innmind\Time\Halt::asAsync()`

### Deprecated

- `Innmind\Time\Halt::async()`

## 1.2.0 - 2026-08-09

### Changed
Expand Down
11 changes: 11 additions & 0 deletions src/Halt.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static function logger(self $self, LoggerInterface $logger): self

/**
* @internal
* @deprecated
*/
#[\NoDiscard]
public static function async(Clock $clock): self
Expand All @@ -65,4 +66,14 @@ public static function via(callable $via): self
{
return new self(Via::of($via));
}

/**
* @internal
* @psalm-mutation-free
*/
#[\NoDiscard]
public function asAsync(Clock $clock): self
{
return new self(Async::of($clock));
}
}
6 changes: 6 additions & 0 deletions src/Halt/Async.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
*/
final class Async implements Implementation
{
/**
* @psalm-mutation-free
*/
private function __construct(
private Clock $clock,
) {
Expand All @@ -33,6 +36,9 @@ public function __invoke(Period $period): Attempt
return $return->unwrap();
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function of(Clock $clock): self
{
Expand Down
Loading