Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Client:Get(remoteId) causing delays #84

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

boatbomber
Copy link
Contributor

@boatbomber boatbomber commented Jan 25, 2023

Closes #83.

I don't write TS/JS often, so please let me know if this is not the way to do things. I essentially just wrote the Luau idiomatic way and converted the syntax to TS. Edit: Turns out even single returns are handled as tuples in roblox-ts to give Roblox APIs a consistent interface. TIL!

Note that it also fixes the rejection message to be more accurate, since the real elapsed time will differ slightly from the set timeout.

Copy link
Contributor

@OverHash OverHash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be possible to simply move the findRemote call to the top of the original code's do loop?

edit: Ah, that will still run the code after (and cause the yield), so you'd need to have the check for result still inside the loop. But this would still be simpler than having two cases (for initial search, and then polling)?

@boatbomber
Copy link
Contributor Author

Sure, but this way of writing is more idiomatic, clear, maintainable, and technically faster bytecode I believe.

@Vorlias Vorlias merged commit b6bd0f2 into roblox-aurora:main Mar 28, 2023
@Vorlias
Copy link
Member

Vorlias commented Mar 28, 2023

Thanks for the contribution! much appreciated!

@boatbomber boatbomber deleted the fix-client-get-delay branch September 29, 2023 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client:Get(remoteId) always waits one Heartbeat
3 participants