Skip to content

v0.13.0

Choose a tag to compare

@Guest0x0 Guest0x0 released this 12 Nov 02:12
· 9 commits to main since this release
  • [breaking] @io.Reader is now always buffered. End users can take benefit from this via the new read_until API, which consumes input stream until a separator is reached. For end users this change should be non-breaking, but custom implementations of @io.Reader will be broken (this is not encouraged, though). The type @io.BufferedReader is no longer useful and is deprecated.
  • add new package moonbitlang/async/cond_var for condition variable. The type @cond_var.Cond can also be accessed via @async.CondVar. It supports a .wait operation, as well as .signal operation for waking up a single waker, and .broadcast for waking up all waiters. See the API doc for more details
  • introduce @io.pipe() and two new types @io.PipeRead & @io.PipeWrite, which implements fully user-space, un-buffered pipe. This is useful for testing and converting writer based function to reader. @pipe.pipe() is still useful for some complex process output collection task, but it may be deprecated in the future once we get replacement for that kind of tasks (e.g. merging output of multiple process)
  • add @http.{get,put,post}_stream, which are streaming version of @http.{get,put,post} and allows lazily read/write response/request body. These API return a @http.Client for lazy IO, which must be manually closed. Though more verbose, this allows precise control of connection lifetime.