Sunday's hangover, so I added a new functionality to my singalrcore library, as usual it works with the microsoft example and i'll try making the syntax closest thing to javascript as possible.
Setup
On Microsoft's example there is a cancellation token on stream function on the server, this example was done without this parameter on the function, so if you want work with the code below just delete this params on the counter function.
Tiny example
Start and open connection
hub_connection = HubConnection(server_url)
hub_connection.build()
hub_connection.start()
Open stream
hub_connection.stream(
"Counter",
[10, 500],
lambda x: print("next callback: ", x),
lambda x: print("complete callback", x),
lambda x: print("error callback", x))
Stream function has five parameters, last three are callback function matching with javascripts suscribe object
ToDo
- message pack
- Auth (now only working by querystring negotiate)
Links
I'm trying to build this library with simplest way possible, so if you think that there is a better way to do it, leave a comment. Asap i'll edit github library contribute section, so any contribution is welcommed.
Thank you for reading, and write any thought below :D
Top comments (0)