ReAdminRBX / roblox-long-polling

Real-Time Roblox Long Polling
MIT License
20 stars 8 forks source link

TypeScript Translation #3

Closed zhiyan114 closed 2 years ago

zhiyan114 commented 2 years ago

TypeScript version of your code. Users can transpiler it to javascript via npm build if they want to avoid using typescript. At the time of this pull request, I haven't tested the code yet so you should definitely do that before merging it. I'll also be testing it with my upcoming project to see how well it goes.

mwalden2004 commented 2 years ago

This is awesome! I recently did this for the scalable version but not the main version. Let me know how your testing goes, and once you confirm it works I'll run it through its paces as well. Great PR though. Thank you so much.

zhiyan114 commented 2 years ago

Looks like it works as intended after a brief testing. I might make another PR to optimize some of the code (better maintainability) but for now, I'll leave everything as it is to avoid breaking changes.

Another thing I've noticed is that Roblox Studio tend to take much longer to exit "testing" state when using the script. I can only assume that there is something that keeps the script from cleaning up on time thus causing the Not running script because past shutdown deadline error.

mwalden2004 commented 2 years ago

You're right, it has something to do with Roblox not closing open HTTP connections, but I can't find any good solution to closing requests. Perhaps sending a request to the server to disconnect it, and making it close all active connections with that ID. This package could use a bit of a refactor, but for now, I'm going to go ahead and merge it.

Thank you very much.