ExpiryRegistrationBase

Struct storing a reference to an expiry time registry and an item in the registry. An instance of this struct should be owned by each client which is to be registered with the expiry time registry.

Constructors

this
this(ITimeoutManagerInternal mgr)

Constructor

Members

Functions

drop
bool drop()

Same as unregister but also removes expirty from list of currently expired registrations. That means it can be called from timeout callbacks, contrary to unregister.

expires
ulong expires()
id
cstring id()

Identifier string for debugging.

register
bool register(ulong timeout_us)

Sets the timeout for the client and registers it with the timeout manager. On timeout the client will automatically be unregistered. The client must not already be registered.

registered
bool registered()
timed_out
bool timed_out()
timeout
ITimeoutClient timeout()

Invokes the timeout() method of the client.

unregister
bool unregister()

Unregisters the current client. If a client is currently not registered, nothing is done.

us_left
long us_left()

Interfaces

ITimeoutManagerInternal
interface ITimeoutManagerInternal

Enables access of TimeoutManager internals.

Variables

client
ITimeoutClient client;

Timeout client: Object that times out after register() has been called when the time interval passed to register() has expired.

expiry
Expiry* expiry;

Reference to an expiry time item in the registry; this is the key returned from register() and passed to unregister(). The expiry item is null if and only if the client is registered with the timeout manager.

Inherited Members

From IExpiryRegistration

register
bool register(ulong timeout_us)

Sets the timeout for the client and registers it with the timeout manager. On timeout the client will automatically be unregistered. The client must not currently be registered.

unregister
bool unregister()

Unregisters the current client. If a client is currently not registered, nothing is done. It depends from the implementation whether the client remains associated to this registration or not.

timed_out
bool timed_out()
timeout
ITimeoutClient timeout()

Invoked by the timeout manager when the client times out. Invokes the timeout() method of the current client.

id
cstring id()

Identifier string for debugging.

Meta