TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.2k stars 385 forks source link

[Request] Add a sleep LUA command #1177

Closed Netbrian closed 5 years ago

Netbrian commented 6 years ago

The Bizhawk implantation of Lua does not seem to include a "sleep" command, and there isn't one built-in to the language. I'd like to request one be added.

The most common use case would be for use with the comm functions, such as sockets or HTTP requests. Being able to sleep while waiting for socket communications without changing emulator state would be useful.

The LUA sockets library should already have a sleep command built in if Bizhawk uses that.

Ashafix commented 5 years ago

When you call comm.socketServerSend(message) (or a related function) the emulator is frozen until one of the following conditions occurs

You can set the time out via comm.socketServerSetTimeout() and comm.httpSetTimeout().

@Netbrian : Is that what you were looking for?

Netbrian commented 5 years ago

I was looking for a generic sleep function, for cases when I'm using a socket library other than what Bizhawk has built in (for instance, ZMQ).