Skip to content

Instantly share code, notes, and snippets.

@dfch
Created September 5, 2014 12:51
Show Gist options
  • Save dfch/d598378f8a162a9bdf5b to your computer and use it in GitHub Desktop.
Save dfch/d598378f8a162a9bdf5b to your computer and use it in GitHub Desktop.
Receiving SignalR messages from PowerShell
$eventName = "receiveMessage";
Add-Type -Path ".\SignalRClient.dll"
$s = New-Object SignalRClient.Connection("http://localhost/", "commandhub");
$s.Start($eventName);
while($true) {
$s.TryDequeue($eventName)
Start-Sleep -seconds 1
}
# string TryDequeue(string eventName)
# string Dequeue(string eventName)
# string Dequeue(string eventName, int dwMillisecondsTotalWaitTime)
# string Dequeue(string eventName, int dwMillisecondsTotalWaitTime, int dwMilliSecondsWaitIntervall)
# System.Collections.Generic.List[string] DequeueAll(string eventName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment