package rio
Ergonomic, composable, efficient read/write streams
Install
dune-project
Dependency
Authors
Maintainers
Sources
riot-0.0.8.tbz
sha256=4ac883cf9ddbf5b3084fd4372300dd07758acbdf1649df5f8a2794e35a99a5e1
sha512=52043592d567b66398d864f3f5c0a3f923007f0125f69a077a34677c60548d5bfb160074bc1847d1153d2c73eb592e2c2488d34fcde4a745fbe72804ad6fcab1
doc/CHANGES.html
Changes
0.0.8
This is the largest Riot release yet, and we are splitting the package into 4 sub-packages:
- the Riot runtime+library
- Bytestring – efficient and ergonomic bytestring manipulation
- Gluon – a low-level, efficient async I/O engine
- Rio – composable I/O streams for vectored operations
Riot Runtime
- Improved performance and memory usage by creating 95% smaller processes, ensuring fibers are always properly discontinued to release their resources, and moving to Weak references for processes to ensure they get garbage collected timely.
- Introduce Process Priorities – the scheduler has been improved to support processes with different priorities (High, Normal, and Low). Thanks @LeedsJohn for the contribution! 👏
- Introduce
receiveTimeouts – you can now callreceive ~after:10L ()and if there are messages fetched in 10 microsecondsreceivewill raise aReceive_timeoutexception that you can match on. - Introduce
syscallTimeouts – any syscall being made now can specify a timeout for an answer. If the syscall isn't ready to retry within the timeout period, aSyscall_timeoutexception will be raised. - Improve
Timer_wheelwith support for clearing timers, iterating timers in the order in which they were created, and a MinHeap backend.
Riot Lib
- New
Dynamic_supervisorto dynamically allocate pools of processes up to a maximum. - New
Runtime.Statsserver can be started to periodically print out statistics about the runtime and the garbage collector. - The
Net.Socketmodule is now split into aTcp_listenerand aTcp_stream, with their corresponding functions for listening, connecting, sending, and receiving. These also include support for timeouts. - New File and File Descriptor operations for seeking. Thanks to @diogomqbm! 👏
- Introduce SSL module to turn sockets into SSL-backed Reader/Writer streams. This includes making a
Net.Socket.stream_socketinto a client or a server SSL-backed stream pair. - Introduce
Taskto quickly spin up processes that we can await. This is the closest we have to a future. ATaskis typed, executes a single function, and MUST be awaited withTask.await ?timeout task. - Introduce
Crypto.Randommodule with high-level utilities for creating random data of different types, including integers of different sizes, strings, bytestrings, bytes, characters, and ASCII strings. - Introduce new named pid functions
Process.where_isandPorcess.await_nameto make it easier to find pids by name, and await a name to be registered. - New
Process.is_alivepredicate to check if a process is alive - Improve logging on most modules with namespaces
- Initializing the Riot runtime twice results in a runtime exception – thanks @julien-leclercq for the contribution! 👏
- Introduce
Ref.castto do type-safe type-casting based on runtime information of a Ref at its instantiation time. - Introduce a
Streammodule that extends the stdlib Seq with areduce_whilecombinator. - Introduce inmemory key-value
Storethat works in a process-friendly fashion, similar to Erlang's ETS.
Bytestring
- First implementation of efficient immutable byte strings with cheap view and concat operations. Thanks to @felipecrv for contributing! 👏
- Iterators and Transient builders for efficiently examining, destructuring, and constructing byte strings from different sources.
- Preliminary Bytestrings syntax support (via a ppx) for constructions and efficient pattern matching using the
%bsigil.
Gluon
- First implementation of an efficient, low-level async I/O engine inspired by Rust's Mio. Gluon uses an opaque Token based approach that lets you directly reference an OCaml value as part of the polled events from the underlying async engine. Thanks to @diogomqbm and @emilpriver for contributing! 👏
- Preliminary support for epoll on Linux and kqueue on macOS with conditional compilation via the
configpackage.
Rio
- First implementation of composable I/O streams via a Read/Write interface inspired by Rust's Read/Write traits.
0.0.7
Introduce IO module with low-level IO operations such as performing direct vectorized (or regular) reads/writes. New operations include:
read,writesingle_read,single_write(vectorized)await_readable,await_writeable,awaitwrite_allcopyandcopy_buffered
- Introduce Buffer module with support for converting from and to CStruct and String, including position tracking.
- Introduce Read/Reader interface for creating buffered and unbuffered readers of arbitrary sources.
- Introduce Write/Writer interfaces for creating unbuffered writers into arbitrary destinations/sinks.
- Introduce File module with Reader and Writer implementations
- Implment Reader and Writer interfaces for Net.Socket
- Dropped dependency on Bigstringaf and moved to Cstruct
- Fix max number of domains to always be under the recommended domain count
- Fix issue with tests where the runtime idled after the main would die. Now the main process finishing with an exception is considered reason enough to shutdown the system.
- Refactor tests to always output
test_name: OKwhen everything is fine and all modules to end in_test. - Add several IO tests.
- Fix log levels for writing to sockets
- Include proper license for C Stubs copied from
lib_eio_posixfor vectorized i/o. - Split test suite into io/non-io so io tests are left outside opam ci
- Improved IO polling that removes heavy iterations over process/fds tables
- Rewrite Dashmap internals to use a Hashtbl
0.0.6
- Redo packaging to expose a single public library:
riot - Fix issue with schedulers busy-waiting
- Introduce separate IO Schedulers for polling
- Switch to
pollto support kqueue on macOS - Reuse read-buffers on Rio.read loops
- Broaden IO socket types to file descriptors
- Improved polling with shorter poll timeouts and safety checks
- Add
Dashmap.iterto iterate over a collection - Add
net_testwith an echo tcp server/client - Fix bugs with syscall suspension that was introduced with reduction counting
0.0.5
- Add
register name pid - Add
unregister name - Add
send_by_name ~name msg - Fix timer wheel making it remove timers correctly
- Add better test for
Timer.send_after
0.0.4
- Internally immediately suspend (bypassing reduction counts) when on a receive expression
- Fix reads from closed Unix sockets
- Fix writes to closed Unix sockets
- Ignore SIGPIPEs on setup
- Fix always mark connected sockets as nonblocking
- Fix GC i/o process table
- Surface pretty-printing of socket values
0.0.3
- Big namespace refactor.
Riot.Runtimeincludes the lower-level runtime blocks, and everything else that is more user-friendly lives at theRiot.*level. - Introduce reduction counting, so processes will run up to N iterations unless they finish, or they execute an unhandled effect.
- Introduce the
Applicationinterface for managing the lifecycle of the system - Fix
Riot.Loggerto fit theApplicationinterface - Add a new
Riot.Telemetrybackend for doing async telemetry
0.0.2
- New
Riot.random ()API to expose current scheduler's random state - Better logging in the
Netmodule - Fix a bug where
Net.Socketoperations where hanging on I/O polling when they could have been eager
0.0.1
First release, including:
- First working version of the scheduler
- Support for process spawning, message passing, monitoring, and linking
- Rudimentary supervisors
- Basic (and incomplete) GenServer
- Scheduling-aware I/O primitives
- Scheduling-aware Logger
- Timers