Closed mchangrh closed 2 years ago
The whole repo is MIT seen here. Nothing specific on connecting, though I just ask you try not to spam it. Ideally listening for push events is more efficient than polling though you do need to make sure you handle re-connect cases and re-subscribe to the servers when that happens (should be rare-ish nowadays, but usually it's 1-3 minutes when I do a deployment every other day or so at this point).
I have the site clients a bit liberal with the reconnect windows mostly to avoid annihilating my server like I used to, and with a large window so if I mess up they should still reconnect as long as I don't have some horrible 25+ minute downtime. 😅 You probably don't need to mirror most of that, since some of the things like MessagePack probably won't even work from non .Net how I have the server configured.
I tried to port your signalR connection as best as I could but keepAlive doesn't work with my client so I send a HasNewerClient
request every 5 minutes with a timeout of 10mins, I hope that's okay.
I'm handling disconnects manually but I'll try to port your WithAutomaticReconnect
since signalR only returns the server name from UpdateMerchantGroup
I end up having to send a GetKnownActiveMerchantGroups
, I tried debugging the websocket but had no such luck, please let me know if I'm missing anything
Yeah, that's probably fine, HasNewerClient is about as close to free as it can get if you just want to use that as a keep alive.
You may not need to worry about the reconnections as much, like if it's just your client you can retry immediately (though probably back off after the first retry), just might want to make sure the total window is 10-20 minutes before you start potentially hard-failures since that's usually what I assume clients have for when I'm messing with deployments.
Strange about the UpdateMerchantGroup. In theory that should be feeding two parameters to the client, the first is the server name then the second is the group data. Is the client not reading them both?
In theory it should be feeding two parameters but the overload doesn't pick it up, I'll try again next cycle.
Ah now they're coming through on the overload - one less call :)
Also FWIW, if you ever need to experiment you can use https://test.lostmerchants.com/MerchantHub.
I only don't make any guarantees that I won't take that one down at random, or have weird things deployed to it, but you can at least sort of test submitting junk and watching it stream back without getting yourself banned from the main site.
Just FYI , if you are listening to the UpdateVoteTotal message, this is going to be changed to send updates in a batch rather than one at a time, probably tonight sometime when the server is at off-peak hours. It's available on https://test.lostmerchants.com/MerchantHub as of now.
See the bottom here for change to API
Normally would prefer not to do a change that breaks like this, but having some performance issues due to more clients => more votes => exponential growth in vote message broadcasts. If I try to do compatibility it'll just increase the messages by double or so during the holdover period which likely will exacerbate the problem.
Thanks for the heads up! Not currently listening for it but will keep it in mind if I do.
In my spring cleaning, I have made my bot public under GPLv3 at https://github.com/mchangrh/cardwatch. It worked wonders for the time it was up and I'm making it public as a thank you for the project ❤️
Thanks for this service, I've been using the call interfaces and a signalR client to roll an integration and was wondering what the licence is for the data on the website and subsequently, the websocket.
As the result reference in #75 has helped tremendously, here are my TypeScript typings