-
-
Save chuckremes/ab075d21917441f0cc85c35d19becb20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def IO.read(offset:, length:, buffer:, sync: true) | |
if sync | |
IO::Sync.read(offset: offset, length: length, buffer: buffer) | |
return buffer | |
else | |
future = IO::Async.read(offset: offset, length: length, buffer: buffer) | |
return future.suspend_until_resolved | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment