- Refactor exception instantiation
- Fix race condition in
Thread#join
- Fix race condition in
Event
class - Add support for open3 API
- Update liburing to version 2.4
- Various fixes to
IO
instance methods - Fix
IO#double_splice
on non-Linux OSes - Implement
IO.copy_stream
- Add
Fiber#value
as alias toFiber#await
- Implement fiber-aware
Monitor
class (#113) - Implement
Thread#value
- Refactor backend_await in io_uring backend
- Fix calling
Timeout.timeout
withnil
or0
(#114) - Rework support for io_uring multishot accept
- Combine SQE submission and waiting for CQE into a single syscall
- Use io_uring for closing a
Polyphony::Pipe
, removing call toclose()
- Implement concurrent
IO#close
- Improve docs
- Use only positional arguments in
IO#read
andIO#readpartial
(#109 @floriandejonckheere)
- Improve cancellation doc page
- Fix linking to liburing under certain conditions (#107)
- Fix reference to
Socket::ZERO_LINGER
(#106 @floriandejonckheere) - Handle error when calling
pidfd_open
- Require Ruby 3.1 or newer
- Add cancellation doc page
- Cleanup code
- Accept array of fiber in
Fiber.await
(in addition to accepting multiple fibers) - Automatically create backend for thread if not already created (#100)
- Fix trap API when used with debug gem (#100)
- Minor improvements to documentation
- Add advanced I/O doc page
- Add
Fiber#receive_loop
API
- Remove liburing man files from gemspec (#103)
- Add cheat-sheet
- Improve and bring up to date doc files: overview, tutorial, FAQ
- Fix image refs in docs (#99) (thanks @paulhenrich)
- More work on docs.
- Reorganize docs, use Yard for all docs.
- Add missing Mutex API methods (#76)
- Fix
IO.foreach
andIO#each_line
(#74) - Fix
SSLServer#accept_loop
(#59) - Update liburing
- Add basic support for UDP sockets
- Fix
IO#read
to return empty string when reading length zero - Fix hang on
require 'polyphony'
in irb session
- Fix working with IRB (#5)
- Rework Redis client adapter
- Fix working with Pry (#95, thanks @floriandejonckheere)
- Improve compatibility with Enumerator and other APIs.
- Remove support for Ruby 2.7
- Add support for explicit Enumerator (external enumeration) (#93)
- Fix
Socket#readpartial
- Fix
receive_all_pending
docs (#92) - Improve linux kernel version detection
- Update liburing
- Always reset SQE user data in io_uring backend
- Fix linux kernel version detection (#89)
- Add support for IO::Buffer in Ruby 3.1 (#80)
- Fix plice on non-Linux OS
- Integrate functionality of
IO.splice_to_eof
intoIO.splice
(#87)
- Add pipe examples
- Implement
Backend#double_splice_to_eof
(io_ring only) - Improve safety of tracing
- Fix possible compilation error on Ruby 2.7.5 (#79)
- Implement compression/decompression to/from strings (#86)
- Improve IO stream compression utilities (release GVL, cleanup on exception)
- Fix compilation on non-Linux OSes
- Fix gemspec
- Reduce write ops in
IO.gzip
(#77) - Add support for read/write method detection for compression/decompression methods (#77)
- Improve
Fiber#shutdown_all_children
- Improve io_uring
wait_event
implementation (share single I/O poll across multiple fibers) - Fix io_uring
write
file offset
- Implement
IO.tee
(#82) - Implement
IO#tee_from
(#81) - Bundle liburing as git submodule
- Implement
Polyphony::Pipe
class,Polyphony.pipe
method (#83) - Add
IO.splice
,IO.splice_to_eof
(#82) - Implement compression/decompression methods (#77)
- Use
POLYPHONY_LIBEV
instead ofPOLYPHONY_USE_LIBEV
environment variable - Add support for working with raw buffers (#78)
- Fix
Backend_recv
regression
- Restore public visibility for
Polyphony::Process.kill_process
- Restore public visibility for
Polyphony::Net.setup_alpn
- Prevent reentry into
trace_proc
- Rename
__parser_read_method__
to__read_method__
- Rename
ResourcePool#preheat!
to#fill
. - Remove ability to use
#cancel_after
or#move_on
without a block - Add #move_on alias to
Fiber#interrupt
- Allow specifying exception in
Fiber#cancel
- Remove deprecated
Polyphony::Channel
class
- Overhaul trace events system (#73)
- Fix Polyphony::Queue API compatibility (#72)
- Fix behaviour of signal traps (#71)
- Comment out
Backend_close
API (#70)
- Fix handling of MoveOn on main fiber of forked process
- Ensure SSLSocket underlying socket is in nonblocking mode
- Add
Polyphony.backend_verify_blocking_mode
API - Fix address resolution for hostnames with IPv6 address
- Improve behaviour of OOB fiber
- Include caller in
fiber_switchpoint
trace
- Add support for IPv6 (#69)
- Override TCPSocket.open
- Fix Gemfile.lock
- Refactor core extensions into separate files for each class
- Improve compatibility with Ruby 3.1
- Improve accuracy of
timer_loop
- Add support for supervising added child fibers
- Do not use io_uring under LinuxKit (#66)
- Fix error message in
Fiber#restart
- refactor
runqueue_ring_buffer_mark
- Fix setting up test server on random port
- Enhance
Fiber#supervise
- Add support for specifying
restart: true
(same asrestart: :always
) - Add support for supervising child fibers (when fibers are not specified)
- Add support for specifying
- Add
Fiber#attach_all_children_to
- Improve
SSLServer#accept
whenservername_cb
is set - Fix
#supervise
in Ruby 3.0
- Fix compilation on Ruby 3.0
- New implementation for
#supervise
- Reset backend state and runqueue on fork
- Rename
#__polyphony_read_method__
to#__parser_read_method__
- Fix missing default value in socket classes'
#readpartial
- Fix linking of operations in
Backend#chain
(io_uring version) - Rename
Fiber#attach
toFiber#attach_to
- Expose original
SSLServer#accept
- Improve fiber monitoring
- Add fiber parking (a parked fiber is prevented from running). This is in preparation for the upcoming work on an integrated debugger.
- Fix all splicing APIs on non-linux OSes (#63)
- Add GC marking of buffers when cancelling read/write ops in io_uring backend
- Add
#__parser_read_method__
method for read method detection
- Add optional raise_on_eof argument to
#readpartial
- Add support for specifying buf and buf_pos in
IO#read
- Fix
Socket#read
to work and conform toIO#read
interface
- Add
runqueue_size
to backend stats
- Add more statistics, move stats to
Backend#stats
- Fix linux version detection (for kernel version > 5.9)
- Fix op ctx leak in io_uring backend (when polling for I/O readiness)
- Add support for appending to buffer in
Backend#read
,Backend#recv
methods - Improve anti-event starvation mechanism
- Redesign fiber monitoring mechanism
- Implement
Fiber#attach
- Add optional maxlen argument to
IO#read_loop
,Socket#recv_loop
(#60) - Implement
Fiber#detach
(#52)
- Accept fiber tag in
Polyphony::Timer.new
- Redesign tracing mechanism and API - now completely separated from Ruby core trace API
- Refactor C code - move run queue into backend
- Implement
Thread#idle_gc_period
,#on_idle
(#56) - Implement
Backend#idle_block=
(#56)
- Implement
Backend#splice_chunks
method for both libev and io_uring backends - Improve waiting for readiness in libev
Backend#splice
,#splice_to_eof
- Enable splice op in libev
Backend#chain
for non-Linux OS
- Implement fake
Backend#splice
,Backend#splice_to_eof
methods for non-Linux OS
- Finish io_uring implementation of Backend#chain
- Reimplement io_uring op_context acquire/release algorithm (using ref count)
- Fix #gets on sockets
- Redesign event anti-starvation mechanism
- Implement Mutex#owned?, #locked? (#50)
- Fix arity for SSLSocket#peeraddr (#55)
- Add missing SSLServer#accept_loop method (#53)
- Fix SSLSocket buffering behaviour
- Add recv_loop alias for SSLSocket (#54)
- Remove
splice
methods on libev backend on non-Linux OS (#43)
- Implement
Backend#splice
,Backend#splice_to_eof
, along withIO#splice
,IO#splice_to_eof
- Polyphony is now compatible with Ruby 3.0
- Add
Backend#sendv
method for sending multiple strings - Accept flags argument in
Backend#send
(#48) - Fix io_uring backend on Ruby 3.0 (#47)
- Implement C-based public backend API:
Polyphony.backend_XXXX
methods - libev backend: Use
pidfd_open
for Linux 5.3+, otherwise use a libev child watcher - Use
:call
as default method in#feed_loop
- Implement
IO#feed_loop
,Socket#feed_loop
- Fix error handling in
Process.kill_and_await
- Set
IOSQE_ASYNC
flag in io_uring backend - Fix error handling in
Backend#waitpid
- Reimplement libev backend's
#waitpid
by using pidfd_open (in similar manner to the io_uring backend)
- Use
Process::CLOCK_MONOTONIC
in Timer - Add
Timer#sleep
,Timer#after
,Timer#every
- Prevent fiber from being resumed after terminating
- Add
Thread#fiber_index_of
method - Use
Backend#wait_event
inFiber#await
- Fix hang with 100s or more child fibers when terminating
- Fix double pending_count increment in io_uring backend
- Use
TCPSocket
instead ofSocket
inNet.tcp_connect
- Catch
Errno::ERSCH
inProcess.kill_and_await
- Set io_uring queue size to 2048
- Implement
Polyphony::Timer
for performant timeouts
- Implement graceful shutdown
- Add support for
break
/StopIteration
inspin_loop
- Fix
IO#gets
,IO#readpartial
- Add missing
Socket#accept_loop
method
- Add
socket_class
argument toBackend#accept
,Backend#accept_loop
- Fix
#supervise
to stop when all children fibers are done
- Add support for Unix sockets
- Enable I/O in signal handlers (#45)
- Accept
:interval
argument in#spin_loop
- Fix API compatibility between TCPSocket and IO
- Implement
#spin_scope
used for creating blocking fiber scopes - Reimplement
move_on_after
,cancel_after
,Timeout.timeout
usingBackend#timeout
(avoids creating canceller fiber for most common use case) - Implement
Backend#timeout
API - Implemented capped queues
- Add
TCPServer#accept_loop
,OpenSSL::SSL::SSLSocket#accept_loop
method - Fix compilation error on MacOS (#43)
- Fix backtrace for
Timeout.timeout
- Add
Backend#timer_loop
- Implement io_uring backend
- Fix compilation error (#43)
- Add support for resetting move_on_after, cancel_after timeouts
- Optimize anti-event starvation polling
- Implement optimized runqueue for better performance
- Schedule parent with priority on uncaught exception
- Fix race condition in
Mutex#synchronize
(#41)
- Improve signal trapping mechanism
- Don't swallow error in
Process#kill_and_await
- Add
Fiber#mailbox
attribute reader - Fix bug in
Fiber.await
- Implement
IO#getc
,IO#getbyte
- Rewrite
Fiber#<<
,Fiber#await
,Fiber#receive
in C
- Fix Net::HTTP compatibility
- Fix fs adapter
- Improve performance of IO#puts
- Mutex#synchronize
- Fix Socket#connect
- Cleanup code
- Improve support for Ruby 3 keyword args
- Cleanup code
- Rename
Agent
toBackend
- Implement
Polyphony::ConditionVariable
- Fix Kernel.system
- Fix reentrant
ResourcePool
(#38) - Add
ResourcePool#discard!
(#35) - Add
Mysql2::Client
andSequel::ConnectionPool
adapters (#35) - Reimplement
Kernel.trap
usingFiber#interject
- Add
Fiber#interject
for running arbitrary code on arbitrary fibers (#39)
- Dump uncaught exception info for forked process (#36)
- Add additional socket config options (#37)
- :reuse_port (
SO_REUSEPORT
) - :backlog (listen backlog, default
SOMAXCONN
)
- :reuse_port (
- Fix possible race condition in Queue#shift (#34)
- Fix race condition when terminating fibers (#33)
- Fix lock release in
Mutex
(#32) - Virtualize agent interface
- Implement
LibevAgent_connect
- Rewrite
Channel
usingQueue
- Rewrite
Mutex
usingQueue
- Reimplement
Event
in C to prevent cross-thread race condition - Reimplement
ResourcePool
usingQueue
- Implement
Queue#size
- Rename
LibevQueue
toQueue
- Reimplement Event using
Agent#wait_event
- Improve Queue shift queue performance
- Introduce
Agent#wait_event
API for waiting on asynchronous events - Minimize
fcntl
syscalls in IO operations
- Fix memory leak in ResourcePool (#31)
- Check and adjust file position before reading (#30)
- Minor documentation fixes
- Allow brute-force interrupting with second Ctrl-C
- Fix outgoing SSL connections (#28)
- Improve Fiber#await_all_children with many children
- Use
writev
for writing multiple strings - Add logo (thanks Gerald!)
- Fix
#read_nonblock
,#write_nonblock
forIO
andSocket
(#27) - Patch
Kernel#p
,IO#puts
to issue single write call - Add support for multiple arguments in
IO#write
andLibevAgent#write
- Use LibevQueue for fiber run queue
- Reimplement LibevQueue as ring buffer
- Reimplement Kernel#trap
- Dynamically allocate read buffer if length not given (#23)
- Prevent CPU saturation on infinite sleep (#24)
- Fix behaviour after call to
Process.daemon
(#8) - Replace core
Queue
class withPolyphony::Queue
(#22) - Make
ResourcePool
reentrant (#1) - Accept
:with_exception
argument incancel_after
(#16)
- Fix sending Redis commands with array arguments (#21)
- Fix compiling C-extension on MacOS (#20)
- Add IO#read_loop
- Fix OpenSSL extension
- More work on docs
- Improve documentation
- Fix backtrace on SIGINT
- Implement LibevAgent#accept_loop, #read_loop
- Move ref counting from thread to agent
- Short circuit switchpoint if continuing with the same fiber
- Always do a switchpoint in #read, #write, #accept
- Introduce System Agent design, remove all
Gyro
classes
- More improvements to stability after fork
- Fix post-fork segfault if parent process has multiple threads with active watchers
- Explicitly kill threads on exit to prevent possible segfault
- Remove Modulation dependency
- More docs
- More C code refactoring
- Fix freeing for active child, signal watchers
- Rename
Fiber#cancel!
toFiber#cancel
- Rename
Gyro::Async#signal!
toGyro::Async#signal
- Use
Fiber#auto_watcher
in thread pool, thread extension - Implement
Fiber#auto_io
for reusing IO watcher instances - Refactor C code
- Add
Fiber#auto_watcher
mainly for use in places likeGyro::Queue#shift
- Refactor C extension
- Improved GC'ing for watchers
- Implement process supervisor (
Polyphony::ProcessSupervisor
) - Improve fiber supervision
- Fix forking behaviour
- Use correct backtrace for fiber control exceptions
- Allow calling
move_on_after
andcancel_after
without block
- Implement
Fiber#supervise
(WIP) - Add
Fiber#restart
API - Fix race condition in
Thread#join
,Thread#raise
(#14) - Add
Exception#source_fiber
- references the fiber in which an uncaught exception occurred
- Accept optional throttling rate in
#spin_loop
- Remove CancelScope
- Allow spinning fibers from a parent fiber other than the current
- Add
#receive_pending
global API. - Prevent race condition in
Gyro::Queue
. - Improve signal handling -
INT
,TERM
signals are now always handled in the main fiber - Fix adapter requires (redis and postgres)
- Fix signal handling race condition (#13)
- Move adapter code into polyphony/adapters
- Fix spin_loop caller, add tag parameter
- Add support for awaiting a fiber from multiple monitor fibers at once
- Implemented child fibers
- Fix TERM and INT signal handling (#11)
- Fix compiling on Linux
- Do not reset runnable value in Gyro_suspend (prevents interrupting timers)
- Don't snooze when stopping a fiber
- Fix IO#read for files larger than 8KB (#10)
- Fix fiber messaging in main fiber
- Prevent signalling of inactive async watcher
- Better fiber messaging
- Pass SignalException to main fiber
- Add (restore) default thread pool
- Prevent race condition in Thread#join
- Add support for cross-thread fiber scheduling
- Remove
#defer
global method - Prevent starvation of waiting fibers when using snooze (#7)
- Improve tracing
- Fix IRB adapter
- Accept block in Supervisor#initialize
- Refactor
ThreadPool
- Implement fiber switch events for
TracePoint
- Add optional tag parameter to #spin
- Correctly increment ref count for indefinite sleep
- Add
irb
adapter - Add support for listen/notify to postgres adapter
- Use
:waiting
,:runnable
,:running
,:dead
for fiber states - Move docs to https://digital-fabric.github.io/polyphony/
- Reimplement
Throttler
using recurring timer - Add
Gyro::Selector
for wrapping libev - Add
Gyro::Queue
, a fiber-aware thread-safe queue - Implement multithreaded fiber scheduling
- Optimize
IO#read_watcher
,IO#write_watcher
- Implement
Fiber#raise
- Fix
Kernel#gets
withARGV
- Return
[pid, exit_status]
fromGyro::Child#await
- Fold
Coprocess
functionality intoFiber
- Add support for indefinite
#sleep
- Extract HTTP code into separate polyphony-http gem
- Cull core, io examples
- Remove
SIGINT
handler
- Remove
API#pulse
- Better repeat timer, reimplement
API#every
- Move global API methods to separate module, include in
Object
instead ofKernel
- Improve setting root fiber and corresponding coprocess
- Fix
ResourcePool#preheat!
- Rename
$Coprocess#list
toCoprocess#map
- Fix
CancelScope#on_cancel
, removeCancelScope#protect
- Remove
auto_run
mechanism. Just usesuspend
! - Optional coverage report for tests
- More tests
- Add
Coprocess.select
andSupervisor#select
methods - Add
Coprocess.join
alias toCoprocess.await
method - Add support for cancelling multiple coprocesses with a single cancel scope
- Fix stopping a coprocess before it being scheduled for the first time
- Rewrite
thread
,thread_pool
modules - Add
Kernel#orig_sleep
alias to sync#sleep
method - Add optional resume value to
Gyro::Async#signal!
- Patch Fiber#inspect to show correct block location
- Add Gyro.run
- Move away from callback-based API for
Gyro::Timer
,Gyro::Signal
- Redesign Gyro scheduling subsystem, go scheduler-less
- More docs
- Rewrite HTTP client agent c1b63787
- Increment Gyro refcount in ResourcePool#acquire
- Rewrite ResourcePool
- Fix socket extensions
- Fix ALPN setup in Net.secure_socket
- Add Coprocess.await (for waiting for multiple coprocesses)
- Add Coprocess#caller, Coprocess#location methods
- Remove callback-oriented Gyro APIs
- Revise signal handling API
- Improve error handling in HTTP/2 adapter
- More documentation
- Refactor and improve CancelScope, ResourcePool
- Reimplement cancel_after, move_on_after using plain timers
- Use Timer#await instead of Timer#start in Pulser
- Rename Fiber.main to Fiber.root
- Replace use of defer with proper fiber scheduling
- Improve Coprocess resume, interrupt, cancel methods
- Cleanup code using Rubocop
- Update and cleanup examples
- Remove fiber pool
- Rename
CoprocessInterrupt
toInterrupt
- Fix ResourcePool, Mutex, Thread, ThreadPool
- Fix coprocess message passing behaviour
- Add HTTP::Request#consume API
- Use bundler 2.x
- Remove separate parse loop fiber in HTTP 1, HTTP 2 adapters
- Fix handling of exceptions in coprocesses
- Implement synthetic, sanitized exception backtrace showing control flow across fibers
- Fix channels
- Fix HTTP1 connection shutdown and error states
- Workaround for IO#read without length
- Rename
next_tick
todefer
- Fix race condition in firing of deferred items, use linked list instead of array for deferred items
- Rename
EV
module toGyro
- Keep track of main fiber when forking
- Add
<<
alias forsend_chunk
in HTTP::Request - Implement Socket#accept in C
- Better conformance of rack adapter to rack spec (WIP)
- Fix HTTP1 adapter
- Better support for debugging with ruby-debug-ide (WIP)
- Rewrite HTTP server for better concurrency, sequential API
- Support 204 no-content response in HTTP 1
- Add optional count parameter to Kernel#throttled_loop for finite looping
- Implement Fiber#safe_transfer in C
- Optimize Kernel#next_tick implementation using ev_idle instead of ev_timer
- Rename Kernel#coproc to Kernel#spin
- Rewrite Supervisor#spin
- Implement IO#read_watcher, IO#write_watcher in C for better performance
- Implement nonblocking (yielding) versions of Kernel#system, IO.popen, Process.detach, IO#gets IO#puts, other IO singleton methods
- Add Coprocess#join as alias to Coprocess#await
- Rename Kernel#spawn to Kernel#coproc
- Fix encoding of strings read with IO#read, IO#readpartial
- Fix non-blocking behaviour of IO#read, IO#readpartial, IO#write
- Reorganize and refactor code
- Allow opening secure socket without OpenSSL context
- Optimize
#next_tick
callback (about 6% faster than before) - Fix IO#<< to return self
- Refactor HTTP code and examples
- Fix race condition in
Supervisor#stop!
- Add
Kernel#snooze
method (EV.snooze
will be deprecated eventually)
- Use chunked encoding in HTTP 1 response
- Rewrite
IO#read
,#readpartial
,#write
in C (about 30% performance improvement) - Add method delegation to
ResourcePool
- Optimize PG::Connection#async_exec
- Fix
Coprocess#cancel!
- Preliminary support for websocket (see
examples/io/http_ws_server.rb
) - Rename
Coroutine
toCoprocess
- Rename Rubato to Polyphony (I know, this is getting silly...)
- Add Coroutine#resume
- Improve startup time
- Accept rate: or interval: arguments for throttle
- Set correct backtrace for errors
- Improve handling of uncaught raised errors
- Implement HTTP 1.1/2 client agent with connection management
- Move reactor loop to secondary fiber, allow blocking operations on main fiber.
- Example implementation of erlang-style generic server pattern (implement async API to a coroutine)
- Implement coroutine mailboxes, Coroutine#<<, Coroutine#receive, Kernel.receive for message passing
- Add Coroutine.current for getting current coroutine
- Rewrite Rubato core for simpler code and better performance
- Implement EV.snooze (sleep until next tick)
- Coroutine encapsulates a task spawned on a separate fiber
- Supervisor supervises multiple coroutines
- CancelScope used to cancel an ongoing task (usually with a timeout)
- Rate throttling
- Implement async SSL server
- Rename Nuclear to Rubato
- Replace nio4r with in-house extension based on libev, with better API, better performance, support for IO, timer, signal and async watchers
- Fix mem leak coming from nio4r (probably related to code in Selector#select)
- Implement resource pool
- transaction method for pg cient
- Async connect for pg client
- Add testing module for testing async code
- Improve HTTP server performance
- Proper promise chaining
- Add http, redis, pg dependencies
- Move ALPN code inside net module
- Code refactored and reogranized
- Fix recursion in next_tick
- HTTP 2 server with support for ALPN protocol negotiation and HTTP upgrade
- OpenSSL server
- Event reactor
- Timers
- Promises
- async/await syntax for promises
- IO and read/write stream
- TCP server/client
- Promised threads
- HTTP server
- Redis interface
- PostgreSQL interface