17.219. Class SessionTableExtensions
Namespace: ArmoniK.Core.Common.Storage
Assembly: ArmoniK.Core.Common.dll
public static class SessionTableExtensions
17.219.1. Inheritance
17.219.2. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
17.219.3. Methods
17.219.3.1. CancelSessionAsync(ISessionTable, string, CancellationToken)
Cancel a session
public static Task<SessionData> CancelSessionAsync(this ISessionTable sessionTable, string sessionId, CancellationToken cancellationToken = default)
17.219.3.1.1. Parameters
sessionTable ISessionTable
Interface to manage sessions lifecycle
sessionId string
Id of the session to cancel
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.219.3.1.2. Returns
The metadata of the cancelled session
17.219.3.1.3. Exceptions
if session was not found or deleted
InvalidSessionTransitionException
if session is in a status that cannot be cancelled
17.219.3.2. CloseSessionAsync(ISessionTable, string, DateTime?, CancellationToken)
Close a session
public static Task<SessionData> CloseSessionAsync(this ISessionTable sessionTable, string sessionId, DateTime? creationDateTime, CancellationToken cancellationToken = default)
17.219.3.2.1. Parameters
sessionTable ISessionTable
Interface to manage sessions lifecycle
sessionId string
Id of the session to purge
creationDateTime DateTime?
Start of the session
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.219.3.2.2. Returns
The metadata of the closed session
17.219.3.2.3. Exceptions
if session was not found or deleted
InvalidSessionTransitionException
if session is in a status that cannot be cancelled
17.219.3.3. GetDefaultTaskOptionAsync(ISessionTable, string, CancellationToken)
Get default task metadata for a session given its id
public static Task<TaskOptions> GetDefaultTaskOptionAsync(this ISessionTable sessionTable, string sessionId, CancellationToken cancellationToken = default)
17.219.3.3.1. Parameters
sessionTable ISessionTable
Interface to manage sessions lifecycle
sessionId string
Id of the target session
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.219.3.3.2. Returns
Task<TaskOptions>
Default task metadata of this session
17.219.3.3.3. Exceptions
if session was not found
17.219.3.4. GetSessionAsync(ISessionTable, string, CancellationToken)
Get SessionData from sessionId
public static Task<SessionData> GetSessionAsync(this ISessionTable sessionTable, string sessionId, CancellationToken cancellationToken = default)
17.219.3.4.1. Parameters
sessionTable ISessionTable
Interface to manage sessions lifecycle
sessionId string
Id of the session to get
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.219.3.4.2. Returns
Data of the session
17.219.3.4.3. Exceptions
if session was not found
17.219.3.5. IsSessionCancelledAsync(ISessionTable, string, CancellationToken)
Query a session status to check if it is canceled
public static Task<bool> IsSessionCancelledAsync(this ISessionTable sessionTable, string sessionId, CancellationToken cancellationToken = default)
17.219.3.5.1. Parameters
sessionTable ISessionTable
Interface to manage sessions lifecycle
sessionId string
Id of the session to check
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.219.3.5.2. Returns
Boolean representing the cancellation status of the session
17.219.3.5.3. Exceptions
if session was not found
17.219.3.6. PauseSessionAsync(ISessionTable, string, CancellationToken)
Pause a session
public static Task<SessionData> PauseSessionAsync(this ISessionTable sessionTable, string sessionId, CancellationToken cancellationToken = default)
17.219.3.6.1. Parameters
sessionTable ISessionTable
Interface to manage sessions lifecycle
sessionId string
Id of the session to pause
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.219.3.6.2. Returns
The metadata of the paused session
17.219.3.6.3. Exceptions
if session was not found or deleted
InvalidSessionTransitionException
if session is in a status that cannot be cancelled
17.219.3.7. PurgeSessionAsync(ISessionTable, string, DateTime?, CancellationToken)
Purge a session
public static Task<SessionData> PurgeSessionAsync(this ISessionTable sessionTable, string sessionId, DateTime? creationDateTime, CancellationToken cancellationToken = default)
17.219.3.7.1. Parameters
sessionTable ISessionTable
Interface to manage sessions lifecycle
sessionId string
Id of the session to purge
creationDateTime DateTime?
Start of the session
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.219.3.7.2. Returns
The metadata of the purged session
17.219.3.7.3. Exceptions
if session was not found or deleted
InvalidSessionTransitionException
if session is in a status that cannot be cancelled
17.219.3.8. ResumeSessionAsync(ISessionTable, string, CancellationToken)
Resume a session
public static Task<SessionData> ResumeSessionAsync(this ISessionTable sessionTable, string sessionId, CancellationToken cancellationToken = default)
17.219.3.8.1. Parameters
sessionTable ISessionTable
Interface to manage sessions lifecycle
sessionId string
Id of the session to resume
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.219.3.8.2. Returns
The metadata of the resumed session
17.219.3.8.3. Exceptions
if session was not found or deleted
InvalidSessionTransitionException
if session is in a status that cannot be cancelled
17.219.3.9. StopSubmissionAsync(ISessionTable, string, bool, bool, CancellationToken)
Stops submission for client and/or worker
public static Task<SessionData> StopSubmissionAsync(this ISessionTable sessionTable, string sessionId, bool client, bool worker, CancellationToken cancellationToken = default)
17.219.3.9.1. Parameters
sessionTable ISessionTable
Interface to manage sessions lifecycle
sessionId string
Id of the session to cancel
client bool
Whether to stop submission for clients
worker bool
Whether to stop submission for worker
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.219.3.9.2. Returns
The metadata of the session
17.219.3.9.3. Exceptions
if session is not found