• Introduction
  • C# API
  • GraphQL API
  • Home
  • Blog
  • Docs
  • GitHub
  • Snowflake.Extensibility.Queueing
  • IAsyncJobQueue<TAsyncEnumerable, T>
Show / Hide Table of Contents
  • Snowflake.Configuration
    • ConfigurationCollection<T>
    • ConfigurationCollectionDescriptor<T>
    • ConfigurationOptionDescriptor
    • ConfigurationOptionType
    • ConfigurationSection<T>
    • ConfigurationSectionDescriptor<T>
    • ConfigurationValueCollection
    • IConfigurationCollection
    • IConfigurationCollection<T>
    • IConfigurationCollectionDescriptor
    • IConfigurationOptionDescriptor
    • IConfigurationProperty
    • IConfigurationSection
    • IConfigurationSection<T>
    • IConfigurationSectionDescriptor
    • IConfigurationTypeMapper
    • IConfigurationValue
    • IConfigurationValueCollection
    • ISelectionOptionDescriptor
    • PathType
    • SelectionOptionDescriptor
  • Snowflake.Configuration.Attributes
    • ConfigurationOptionAttribute
    • ConfigurationSectionAttribute
    • ConfigurationTargetAttribute
    • ConfigurationTargetMemberAttribute
    • CustomMetadataAttribute
    • InputTemplateAttribute
    • SelectionOptionAttribute
  • Snowflake.Configuration.Input
    • DictionaryInputMapping
    • IDeviceInputMapping
    • IInputOption
    • IInputSerializer
    • IInputTemplate
    • IInputTemplate<T>
    • InputConfigurationSection<T>
    • InputOption
    • InputOptionAttribute
    • InputTemplate<T>
  • Snowflake.Configuration.Interceptors
    • ConfigurationInterceptor
  • Snowflake.Configuration.Serialization
    • AbstractConfigurationNode<T>
    • BooleanConfigurationNode
    • ConfigurationTarget
    • ConfigurationTraversalContext
    • DecimalConfigurationNode
    • DeviceCapabilityElementConfigurationNode
    • EnumConfigurationNode
    • IAbstractConfigurationNode
    • IAbstractConfigurationNode<T>
    • IConfigurationSerializationContext<T>
    • IConfigurationTarget
    • IConfigurationTransformer<TOutput>
    • IConfigurationTraversalContext
    • IntegralConfigurationNode
    • ListConfigurationNode
    • StringConfigurationNode
    • UnknownConfigurationNode
  • Snowflake.Configuration.Serialization.Serializers
    • AbstractStringConfigurationSerializer
    • ConfigurationSerializer<T>
    • StringSerializationContext
    • StringSerializationContextExtensions
  • Snowflake.Configuration.Serialization.Serializers.Implementations
    • SimpleCfgConfigurationSerializer
    • SimpleIniConfigurationSerializer
    • SimpleJsonConfigurationSerializer
    • SimpleXmlConfigurationSerializer
  • Snowflake.Extensibility
    • IEmptyPluginConfiguration
    • ILogger
    • IPlugin
    • IPluginCollection<T>
    • LogLevel
    • PluginAttribute
    • PluginCollection<T>
    • PluginInfoFields
  • Snowflake.Extensibility.Configuration
    • IPluginConfigurationStore
  • Snowflake.Extensibility.Provisioning
    • IPluginProperties
    • IPluginProvision
    • IProvisionedPlugin
    • PluginProvision
    • ProvisionedPlugin
  • Snowflake.Extensibility.Provisioning.Standalone
    • StandalonePlugin
    • StandalonePluginProvision
  • Snowflake.Extensibility.Queueing
    • IAsyncJobQueue
    • IAsyncJobQueue<T>
    • IAsyncJobQueue<TAsyncEnumerable, T>
    • IAsyncJobQueueFactory
  • Snowflake.Filesystem
    • DirectoryExtensions
    • FileExtensions
    • IDirectory
    • IFile
    • IIndelibleDirectory
    • IReadOnlyDirectory
    • IReadOnlyFile
  • Snowflake.Input.Controller
    • ControllerElement
    • ControllerElementCollection
    • ControllerElementExtensions
    • ControllerElementInfo
    • ControllerElementType
    • ControllerElementTypeExtensions
    • ControllerId
    • IControllerElementCollection
    • IControllerElementInfo
    • IControllerLayout
    • InvalidControllerIdException
  • Snowflake.Input.Controller.Mapped
    • ControllerElementMapping
    • ControllerElementMappingProfile
    • IControllerElementMappingProfile
    • IControllerElementMappingProfileStore
  • Snowflake.Input.Device
    • DefaultDeviceCapabilityLabels
    • DeviceCapability
    • DeviceCapabilityClass
    • DeviceCapabilityClasses
    • DeviceCapabilityExtensions
    • DeviceLayoutMapping
    • DictionaryDeviceCapabilityLabels
    • DirectInputDeviceInstance
    • IDeviceCapabilityLabels
    • IDeviceLayoutMapping
    • IInputDevice
    • IInputDeviceInstance
    • InputDriver
    • KeyboardDeviceInstance
    • PassthroughDeviceInstance
    • XInputDeviceInstance
  • Snowflake.Installation
    • AsyncInstallTask<T>
    • AsyncInstallTaskEnumerable<T>
    • ITaskResult
    • TaskResult
    • TaskResult<T>
  • Snowflake.Installation.Extensibility
    • GameInstaller
    • IGameInstaller
    • IInstallable
    • Installable
    • SupportedPlatformAttribute
  • Snowflake.Installation.Tasks
    • CopyDirectoryContentsTask
    • CopyFileTask
    • ExecuteAsyncTask<TResult>
    • ExtractZipTask
    • FailureTask<T>
  • Snowflake.Loader
    • IComposable
    • IModule
    • IModuleEnumerator
    • IModuleLoader<T>
    • ImportServiceAttribute
    • IServiceRepository
    • Module
  • Snowflake.Model.Database.Exceptions
    • DependentEntityNotExistsException
    • EntityAlreadyExistsException
  • Snowflake.Model.Database.Migrations
    • Empty
    • InitialCreate
  • Snowflake.Model.Game
    • Game
    • IGame
    • IGameExtension
    • IGameLibrary
    • IPlatformInfo
    • ISystemFile
    • PlatformId
  • Snowflake.Model.Game.LibraryExtensions
    • GameConfigurationExtensionExtensions
    • GameFileExtensionExtensions
    • IGameConfigurationExtension
    • IGameConfigurationExtensionProvider
    • IGameExtensionProvider
    • IGameExtensionProvider<TExtension>
    • IGameFileExtension
    • IGameFileExtensionProvider
  • Snowflake.Model.Records
    • FileRecord
    • GameRecord
    • IMetadataCollection
    • IRecord
    • IRecordMetadata
    • IRecordMetadataQuery
    • MetadataCollection
    • RecordMetadata
  • Snowflake.Model.Records.File
    • FileMetadataKeys
    • IFileRecord
    • ImageMetadataKeys
    • ImageTypes
  • Snowflake.Model.Records.Game
    • GameMetadataKeys
    • IGameRecord
    • IGameRecordQuery
  • Snowflake.Orchestration.Extensibility
    • EmulatedController
    • EmulatedPortsManager
    • EmulatorCompatibility
    • EmulatorOrchestrator
    • GameEmulation
    • GameEmulation<TConfigurationCollection>
    • GameEmulationState
    • IEmulatedController
    • IEmulatedPortDeviceEntry
    • IEmulatedPortsManager
    • IEmulatedPortStore
    • IEmulatorOrchestrator
    • IGameEmulation
  • Snowflake.Orchestration.Extensibility.Extensions
    • DeviceEnumeratorExtensions
  • Snowflake.Orchestration.Process
    • IEmulatorExecutable
    • IEmulatorExecutableProvider
    • IProcessBuilder
    • ProcessExtensions
  • Snowflake.Orchestration.Saving
    • GameFileExtensionGameSaveManagerExtensions
    • IGameSaveManager
    • ISaveGame
    • ISaveProfile
    • SaveGame
    • SaveManagementStrategy
  • Snowflake.Orchestration.SystemFiles
    • ISystemFileProvider
  • Snowflake.Persistence
    • ISqlDatabase
    • SqliteDatabase
    • SqliteMemoryDatabase
  • Snowflake.Remoting.Electron
    • IElectronPackage
    • IElectronPackageProvider
  • Snowflake.Remoting.Kestrel
    • IKestrelServerMiddlewareProvider
    • IKestrelWebServerService
  • Snowflake.Romfile
    • IFileSignature
    • IRomFileInfo
    • IStructuredFilename
    • NamingConvention
    • RomFileInfo
    • StructuredFilename
  • Snowflake.Romfile.Extensions
    • StringExtensions
  • Snowflake.Romfile.Tokenizer
    • FieldType
    • GoodToolsTokenClassifier
    • NoIntroTokenClassifier
    • StructuredFilenameToken
  • Snowflake.Scraping
    • GameScrapeContext
    • IScrapeContext
    • ISeed
    • ISeedRootContext
    • Seed
    • SeedContent
    • SeedRootContext
  • Snowflake.Scraping.Extensibility
    • AttachTarget
    • Culler
    • Directive
    • DirectiveAttribute
    • FileInstallationTraverserBase
    • GameMetadataTraverserBase
    • ICuller
    • IFileInstallationTraverser
    • IGameMetadataTraverser
    • IScraper
    • IScraperDirective
    • ITraverser<TProducts, TEffectTarget>
    • Scraper
    • SeedBuilder
    • SeedTree
    • Traverser<TProducts, TEffectTarget>
  • Snowflake.Services
    • IContentDirectoryProvider
    • IDeviceEnumerator
    • ILogProvider
    • IPluginManager
    • IServiceEnumerator
    • IServiceRegistrationProvider
    • IStoneProvider
  • Snowflake.Shiragame
    • IRomInfo
    • ISerialInfo
    • IShiragameProvider
    • RomInfo
    • SerialInfo

Interface IAsyncJobQueue<TAsyncEnumerable, T>

A queue for long-existing System.Collections.Generic.IAsyncEnumerable<T> that represent a collection of long running resumable jobs. This variant allows for higher-kinded implementations of System.Collections.Generic.IAsyncEnumerable<T>.

Inherited Members
IAsyncJobQueue.HasJob(Guid)
IAsyncJobQueue.GetActiveJobs()
IAsyncJobQueue.GetQueuedJobs()
IAsyncJobQueue.GetZombieJobs()
IAsyncJobQueue.RequestCancellation(Guid)
Namespace: Snowflake.Extensibility.Queueing
Assembly: Snowflake.Framework.Primitives.dll
Syntax
public interface IAsyncJobQueue<TAsyncEnumerable, T> : IAsyncJobQueue where TAsyncEnumerable : class, IAsyncEnumerable<T>
Type Parameters
Name Description
TAsyncEnumerable

The type that implements System.Collections.Generic.IAsyncEnumerable<T>

T

The type of elements in the enumerable.

Methods

AsEnumerable(Guid)

Gets the remaining values in the enumerator as an System.Collections.Generic.IAsyncEnumerable<T> that can be looped on.

Looping on this will exhaust the enumerator, and therefore using after enumerating the returned enumerable here will never return results.

Declaration
IAsyncEnumerable<T> AsEnumerable(Guid jobId)
Parameters
Type Name Description
System.Guid jobId

The job token that was returned by QueueJob(TAsyncEnumerable)

Returns
Type Description
System.Collections.Generic.IAsyncEnumerable<T>

The remaining values in the enumerator as an System.Collections.Generic.IAsyncEnumerable<T>

GetCurrent(Guid)

Retrieves the current value in the enumerator and whether or not the enumerator is exhausted. Once the enumerator is exhausted, the value field will always be default(T), and hasNext will be false.

Declaration
T GetCurrent(Guid jobId)
Parameters
Type Name Description
System.Guid jobId

The job token that was returned by QueueJob(TAsyncEnumerable)

Returns
Type Description
T

The value, or null if the current value is null.

GetNext(Guid)

Retrieves the next value in the enumerator and whether or not the enumerator is exhausted. Once the enumerator is exhausted, the value field will always be default(T), and movedNext will be false.

Declaration
ValueTask<(T value, bool movedNext)> GetNext(Guid jobId)
Parameters
Type Name Description
System.Guid jobId

The job token that was returned by QueueJob(TAsyncEnumerable)

Returns
Type Description
System.Threading.Tasks.ValueTask<System.ValueTuple<T, System.Boolean>>

The next value and whether or not to continue iterating.

GetSource(Guid)

Get the System.Collections.Generic.IAsyncEnumerable<T> as it was added to the job queue.

Declaration
TAsyncEnumerable GetSource(Guid jobId)
Parameters
Type Name Description
System.Guid jobId

The jobId

Returns
Type Description
TAsyncEnumerable

The System.Collections.Generic.IAsyncEnumerable<T> as it was added to the job queue.

QueueJob(TAsyncEnumerable)

Declaration
ValueTask<Guid> QueueJob(TAsyncEnumerable asyncEnumerable)
Parameters
Type Name Description
TAsyncEnumerable asyncEnumerable
Returns
Type Description
System.Threading.Tasks.ValueTask<System.Guid>

QueueJob(TAsyncEnumerable, Guid)

Queues an System.Collections.Generic.IAsyncEnumerable<T> into the job queue with your own job token. If this job token already exists, this will replace the old job, which will be disposed.

Declaration
ValueTask<Guid> QueueJob(TAsyncEnumerable asyncEnumerable, Guid guid)
Parameters
Type Name Description
TAsyncEnumerable asyncEnumerable

The System.Collections.Generic.IAsyncEnumerable<T> to persist in memory.

System.Guid guid

A token to refer to the job at a later time.

Returns
Type Description
System.Threading.Tasks.ValueTask<System.Guid>

The System.Guid token you passed in guid.

TryRemoveSource(Guid, out TAsyncEnumerable)

Tries to remove the System.Collections.Generic.IAsyncEnumerable<T> as it was added to the job queue. This will only succeed if there are no active jobs for the enumerable in the queue, and it was not automatically disposed.

If not automatically disposed, this means that the enumerable must be exhausted or cancelled with RequestCancellation(Guid) before it can be removed.

Declaration
bool TryRemoveSource(Guid jobId, out TAsyncEnumerable asyncEnumerable)
Parameters
Type Name Description
System.Guid jobId

The jobId

TAsyncEnumerable asyncEnumerable

The async enumerable that is removed, or null if the result is false.

Returns
Type Description
System.Boolean

If the enumerable was successfully removed.

In This Article
  • Methods
    • AsEnumerable(Guid)
    • GetCurrent(Guid)
    • GetNext(Guid)
    • GetSource(Guid)
    • QueueJob(TAsyncEnumerable)
    • QueueJob(TAsyncEnumerable, Guid)
    • TryRemoveSource(Guid, out TAsyncEnumerable)
Built with ❤️ by @chyyran. Text content licensed under CC-BY-SA 4.0.