ClockModule
PackageAxial.PlatformService
Helpers for the clock service.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| service | Clock.service | Reads the service from the environment. |
| now | Clock.now | Reads the current UTC timestamp from an explicit clock service. |
| utcDateTime | Clock.utcDateTime | Reads the current UTC date/time from an explicit clock service. |
| unixTimeSeconds | Clock.unixTimeSeconds | Reads the current Unix timestamp in seconds from an explicit clock service. |
| unixTimeMilliseconds | Clock.unixTimeMilliseconds | Reads the current Unix timestamp in milliseconds from an explicit clock service. |
| live | Clock.live | Creates a live clock backed by . |
| fromValue | Clock.fromValue utcNow | Creates a deterministic clock that always returns the supplied instant. |
| layer | Clock.layer | Builds the live clock as a layer. |
Reads the service from the environment.
Returns
Flow<'env, 'error, IClock>
Reads the current UTC timestamp from an explicit clock service.
Returns
Flow<'env, 'error, DateTimeOffset>
Reads the current UTC date/time from an explicit clock service.
Returns
Flow<'env, 'error, DateTime>
Reads the current Unix timestamp in seconds from an explicit clock service.
Returns
Flow<'env, 'error, int64>
Reads the current Unix timestamp in milliseconds from an explicit clock service.
Returns
Flow<'env, 'error, int64>
Creates a deterministic clock that always returns the supplied instant.
Parameters
| Name | Type | Description |
|---|---|---|
| utcNow | DateTimeOffset |
Returns
IClock

