Skip to content

v0.5.1 - Beta

Pre-release
Pre-release
Compare
Choose a tag to compare
@anonhostpi anonhostpi released this 17 Jan 07:09
· 37 commits to main since this release

Release Notes:

Hotfix for cached packages

Fix TempPath issues

To test, install it with PowerShell and PackageManagement (OneGet)

Import-Module Import-Package
# Import-Module New-DispatchThread # - v0.2.1
Import-Module New-ThreadController # - v0.3.0

# --- Avalonia ---

Import-Package Avalonia.Desktop -Offline
# Import-Package Avalonia.Win32 -Offline]

# --- ThreadExtensions ---

Set-DispatcherFactory ([ThreadExtensions.Dispatcher])

$t1 = New-ThreadController
$t1.Invoke({ Write-Host "test - ThreadExtensions" }).
    Invoke({ Write-Host "done - ThreadExtensions" }, $true) | Out-Null

# --- WPF ---

Write-Host
Set-DispatcherFactory ([System.Windows.Threading.Dispatcher])

$t2 = New-ThreadController -Name "Tester"
$t2.Invoke({ Write-Host "test - WPF" }).
    Invoke({ Write-Host "done - WPF" }, $true) | Out-Null

# Now supports Async scriptblocks:

Async { Write-Host "test - async 1" } -Sync # automatically disposed runspace
Async { Write-Host "test - async 2" } -Thread $t1 -Sync # if you don't want to dispose the runspace, you can use an existing one
Async { Write-Host "test - async 3" } -Thread "Tester" # you can also specify the thread by its name
 
Write-Host
Write-Host (Get-Runtime)
Write-Host
Write-Host "Threads:"

$Threads = Get-Threads
$Threads

Links: