#### [Abblix\.Oidc\.Server](https://www.abblix.com/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.Storages](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages 'Abblix\.Oidc\.Server\.Features\.Storages')

## IPollScheduleStore Interface

Remembers, per polled request, the earliest moment its client may ask again\.

```csharp
public interface IPollScheduleStore
```

Derived  
↳ [PollScheduleStore](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Storages.PollScheduleStore 'Abblix\.Oidc\.Server\.Features\.Storages\.PollScheduleStore')

### Remarks
A record of its own rather than a field on the request it belongs to, and that is the whole point\. The
polling client asks often and the thing it changes is only this instant, while the user's approval
changes the request's status \- and a poll that wrote the request back to note the instant overwrote an
approval that had landed since it read\. The user approved, and the device was told to keep waiting
until the code expired\.

Two polls of the same request can still overwrite each other here, and that is harmless: both write
about the same instant, give or take the time between them. What cannot happen any more is a poll
writing anything the approval owns.

Absence means the client may ask now, so nothing is written when a request is created. The entry
expires with the request it belongs to, which is why every write states the remaining lifetime.
### Methods

## IPollScheduleStore\.SetNextPollAtAsync\(string, DateTimeOffset, TimeSpan\) Method {#Abblix.Oidc.Server.Features.Storages.IPollScheduleStore.SetNextPollAtAsync(string,System.DateTimeOffset,System.TimeSpan)}

Records the earliest moment this request's client may ask again\.

```csharp
System.Threading.Tasks.Task SetNextPollAtAsync(string key, System.DateTimeOffset nextPollAt, System.TimeSpan expiresIn);
```
#### Parameters

###### `key` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.Storages.IPollScheduleStore.SetNextPollAtAsync(string,System.DateTimeOffset,System.TimeSpan).key}

The storage key naming this request's poll schedule\.

###### `nextPollAt` [System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset') {#Abblix.Oidc.Server.Features.Storages.IPollScheduleStore.SetNextPollAtAsync(string,System.DateTimeOffset,System.TimeSpan).nextPollAt}

The instant before which the client is told to slow down\.

###### `expiresIn` [System\.TimeSpan](https://learn.microsoft.com/en-us/dotnet/api/system.timespan 'System\.TimeSpan') {#Abblix.Oidc.Server.Features.Storages.IPollScheduleStore.SetNextPollAtAsync(string,System.DateTimeOffset,System.TimeSpan).expiresIn}

What the request it belongs to has left, so the entry cannot outlive it\.

#### Returns
[System\.Threading\.Tasks\.Task](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 'System\.Threading\.Tasks\.Task')

## IPollScheduleStore\.TryGetNextPollAtAsync\(string\) Method {#Abblix.Oidc.Server.Features.Storages.IPollScheduleStore.TryGetNextPollAtAsync(string)}

The earliest moment this request's client may ask again, or null when it may ask now\.

```csharp
System.Threading.Tasks.Task<System.Nullable<System.DateTimeOffset>> TryGetNextPollAtAsync(string key);
```
#### Parameters

###### `key` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.Storages.IPollScheduleStore.TryGetNextPollAtAsync(string).key}

The storage key naming this request's poll schedule\.

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[System\.Nullable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1 'System\.Nullable\`1')[System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1 'System\.Nullable\`1')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
The instant, or null when none is recorded\.
