XasWorks / XasCode

Repository of all the important multi-project libraries
GNU General Public License v3.0
5 stars 2 forks source link

Fix wait_for #25

Open Xasin opened 6 years ago

Xasin commented 6 years ago

See Reviewable comment in #22 by CyanRainNin:

According to comment above the block is optional. So this blocks the main thread? How about spawning a thread to handle setting a false/true fiber-variable and unregistering after timeout. When you return that the receiver can use .join if it is supposed to be blocking.

To avoid breaking existing code, you could do the above as a new wait_for_async method implementation

It's a good idea, definitely something for later!