Lifespan.snapshot constructor
Creates a snapshot that may be serialized and deserialized back to dynamic Lifespan
ttl
Time to live
clock
Clock implementation
Implementation
factory Lifespan.snapshot(int ttl, [ Clock clock = Clock.system ]) {
final wasBorn = clock.getMillis();
return Lifespan._private(
wasBorn,
ttl,
_SnapshotValidation(_isValid(wasBorn, ttl, clock))
);
}