New-PodeStateSet
SYNOPSIS
Creates a new concurrent hash set for use in the shared state.
SYNTAX
New-PodeStateSet [[-Data] <Object[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Creates a new concurrent hash set for use in the shared state. This is useful for storing a collection of unique objects in a thread-safe manner.
EXAMPLES
EXAMPLE 1
Set-PodeState -Name 'MySet' -Value (New-PodeStateSet)
EXAMPLE 2
Set-PodeState -Name 'MySet' -Value (New-PodeStateSet -Data @('Item1', 'Item2', 'Item3'))
PARAMETERS
-Data
An optional array of initial objects to populate the hash set.
Type: Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
Pode.Utilities.Structures.PodeConcurrentSet`1[[System.Object, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
System.Object[]
NOTES
This uses a custom concurrent set implementation to ensure thread safety and uniqueness of items. The PodeConcurrentSet class is defined in the Pode.Utilities.Structures namespace.