[ruby-talk:444757] [ANN] xchan.rb v0.20.0 Released
# About xchan.rb is an easy to use, minimalist library for InterProcess Communication (IPC). The library provides a channel that can help facilitate communication between Ruby processes who have a parent <=> child relationship. A channel lock is provided by lockf(3) and a temporary, unlinked file to protect against race conditions that can happen when multiple processes access the same channel at the same time. # Features * Minimalist IPC for parent <=> child processes. * Channel-based communication. * Support for multiple serializers (`:marshal`, `:json`, `:yaml`) * Support for raw string communication (`:pure`). * Blocking (`#send`, `#recv`) operations * Non-blocking (`#send_nonblock`, `#recv_nonblock`) operations. * Built-in file-based locking (lockf(3)) * Option to use a null lock for scenarios where locking is not needed. * Access to underlying UNIX sockets for control over socket options. * Mac, BSD, and Linux support. * Good docs. # Example #!/usr/bin/env ruby require "xchan" ## # Marshal as the serializer ch = xchan(:marshal) Process.wait fork { ch.send(5) } puts "#{ch.recv} + 7 = 12" ch.close ## # 5 + 7 = 12 # Links https://github.com/0x1eef/xchan.rb#readme https://rubygems.org/gems/xchan.rb Best regards, Robert
participants (1)
-
Robert