Class UserClock
- Namespace
- MailFathom.Application.Access
- Assembly
- MailFathom.Application.dll
Reads the wall clock the person this work is being done for is standing on.
public sealed class UserClock
- Inheritance
-
UserClock
- Inherited Members
Remarks
Every operation that has to resolve this week or since Tuesday needs the same two things — the current instant and that person's zone — and this is the one place the two meet. It exists so the source of an anchor is shared even though its insertion is not: an operation states its own anchor on its own turn, but no operation decides for itself which clock or which zone that anchor came from.
The person is the one the work was admitted for rather than an argument, because every caller means exactly that one and a parameter would be somewhere for the wrong user to be passed. Work reached under a principal acting for nobody is refused here as it is everywhere else, which is what keeps an anchor from being resolved for a deployment administrator whose acts are the deployment's rather than one person's.
A concrete type rather than a port. It composes two seams that are already ports and holds no decision of its own, so a test substitutes the clock and the zones rather than this.
Constructors
- UserClock(AccessAuthorization, IUserTimeZones, TimeProvider)
Initializes the clock over the acting person, their zone, and this deployment's time source.
Methods
- Now()
Reads the instant the acting person is standing on, carrying their own offset.