mandrewcito / signalrcore

SignalR Core python client
https://mandrewcito.github.io/signalrcore/
MIT License
119 stars 57 forks source link

- #37

Closed ghost closed 4 years ago

ghost commented 4 years ago

Solved

mandrewcito commented 4 years ago

Same as #36. This library is a aspnet core signalr implementation, but hubs you are connecting to are asp signalr hubs, protocol is different from aspnet core signalr hubs. Did you try this library https://pypi.org/project/signalr-client/ ?

ghost commented 4 years ago

Yes, my bad. I will look into it more carefully. My apologies, you must have a lot of these questions a day. It is all a bit confusing.

mandrewcito commented 4 years ago

Don't mind, you can ask anything. Is the other library maintained yet? . If is not, did would you consider useful, an option to a backwards compatibility with previous signalr?.

ghost commented 4 years ago

Seems outdated to me.

ghost commented 4 years ago

Your library was useful, i had to change the https into wss, my bad.

ghost commented 4 years ago

However. i don't understand

hub_connection.stream( "Counter", [10, 500]).subscribe({ "next": lambda x: print("next callback: ", x), "complete": lambda x: bye(False, x), "error": lambda x: bye(True, x) })

as the documentation hasn't been clear on this? What does [10, 500] refer to? Also how would this work out with https://github.com/simplefx-ltd/simplefx-api#subscribe-for-quotes ? I am in confusion :)

mandrewcito commented 4 years ago

As i said documentation that are pointing on simplefx is a aspnet signalr hub, this library is an aspnet core signalr hub. However, as i read in docs you need first to send a 'subscribeList' and then listen to a 'ReceiveQuotes', this subscription that you are calling is to stream a certain number of elemets(https://docs.microsoft.com/es-es/aspnet/core/signalr/streaming?view=aspnetcore-3.1).

ghost commented 4 years ago

So there is no way that this can work with this library? Because it appears to, with the correct send and receive messages set up? So i can't send/receive message with this library? Also i still don't know what [10, 500] is used for in example:"

hub_connection.stream(
"Counter",
[10, 500]).subscribe({
"next": lambda x: print("next callback: ", x),
"complete": lambda x: bye(False, x),
"error": lambda x: bye(True, x)
})

I don't think i understand.

mandrewcito commented 4 years ago

In the example [10, 500] meaning was 10 items 500 ms interval per item. Works with this example.

If this api is an old aspnet signalr you can use https://pypi.org/project/signalr-client/.

I never made aspnet signalr implementation on python becaouse this client already had been working.

ghost commented 4 years ago

The signalr-client actually gives the same error. Error 400, the same as this library. So i suppose either im doing the same thing wrong twice or this library could also work?

ghost commented 4 years ago

i believe it is using the newer version of signalr aspnet. how would one even make a aspnet signalr implementation to begin with?

ghost commented 4 years ago

@mandrewcito , would you be so kind to delete this issue please?