omq 0.28.8 → 0.28.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ed8a560eb7abf29a97bdae6a35baaf18bfe1ef47476a33691f7d5ad2fdf2914
4
- data.tar.gz: 91b6416e4ce9110cf13f73bd7a7b8fdc97b994132f718f99f3dcd2cff4030857
3
+ metadata.gz: 7f251093afa3c8f3ff07a187f3050535c839dda05f8ccb7dc3f42ea34706fea0
4
+ data.tar.gz: e1ed93a70c9167bc6df560c57d80411904a3d6fdcaa19ba148887f7f044fb9fa
5
5
  SHA512:
6
- metadata.gz: 41fbe26e73c2dae30b30a74ba347e9c1a52781ec13d7ecc4ee98f80e715e8a3c83f95a47adeac5294238a1cc29b8359bc1c7b6ae96320036855f789062b87eb7
7
- data.tar.gz: 539696d1162ac357f319664657a33cb3cada7d6968a42b1cf3855498fee1ec1deaa1ff6ab340860c536784cfde2d53328496f7014c398b933ab36843ff86a02a
6
+ metadata.gz: 8c3b77d4c81dd3b4f7c66decefd86515fcba6fc69683a7f5dc9a829436429d74bc301d65c506b845ff2003e36d9d9c6cbe30f1c665b2baffe7fe31ebe9d7d399
7
+ data.tar.gz: afc55dd9e6c1c146ba3b948ec1590bfb5df7589c33a528c7646c22b1fb71489e1abf26400b4966afa7caa2777279b12293d5e36ca04c7f029c5b372ddc887b5b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.28.10] - 2026-08-26
6
+
7
+ ### Changed
8
+
9
+ - Default to `omq-backend-rust` when no backend is specified and native
10
+ `Fiber.scheduler` is unavailable.
11
+
12
+ ## [0.28.9] - 2026-08-26
13
+
14
+ ### Fixed
15
+
16
+ - Used `SocketError` when `Socket::ResolutionError` is unavailable, so
17
+ `require "omq"` works on JRuby.
18
+
5
19
  ## [0.28.8] - 2026-08-08
6
20
 
7
21
  ### Added
data/README.md CHANGED
@@ -61,9 +61,12 @@ gem 'omq'
61
61
 
62
62
  ### Ruby Engines
63
63
 
64
- MRI Ruby 3.3 and 4.0 can use the pure Ruby backend. TruffleRuby should use
65
- the Rust backend with `backend: :rust`; the pure Ruby backend is not supported
66
- there because OMQ needs native `Fiber.scheduler` behavior.
64
+ MRI Ruby 3.3 and 4.0 can use the pure Ruby backend. TruffleRuby and JRuby
65
+ should use the Rust backend with `backend: :rust`; the pure Ruby backend is
66
+ not supported there because OMQ needs native `Fiber.scheduler` behavior.
67
+ JRuby support uses OMQ.java on Java 25 or newer. The Java gem selects the
68
+ matching OMQ.java artifact on Linux x86_64, macOS aarch64, macOS x86_64, and
69
+ Windows x86_64.
67
70
 
68
71
  ## Quick Start
69
72
 
@@ -223,8 +226,8 @@ See the [omq-cli README](https://github.com/paddor/omq-cli) for full documentati
223
226
 
224
227
  ## Optional Rust backend
225
228
 
226
- Install `omq-backend-rust` for a Rust/omq-tokio backend. Same socket API,
227
- but connection handling runs in native code on a Tokio runtime.
229
+ Install `omq-backend-rust` for an OMQ.rs backend through the first-class
230
+ `omq-rs` binding. Same socket API, with connection handling on a Tokio runtime.
228
231
 
229
232
  The Rust backend also supports TruffleRuby. The pure Ruby backend currently
230
233
  requires MRI-style native `Fiber.scheduler` support, so use `backend: :rust`
data/lib/omq/constants.rb CHANGED
@@ -43,6 +43,7 @@ module OMQ
43
43
  IO::Stream::ConnectionResetError,
44
44
  ]
45
45
 
46
+ RESOLUTION_ERROR = defined?(Socket::ResolutionError) ? Socket::ResolutionError : SocketError
46
47
 
47
48
  # Errors raised when a peer cannot be reached.
48
49
  CONNECTION_FAILED = [
@@ -52,7 +53,7 @@ module OMQ
52
53
  Errno::EHOSTUNREACH,
53
54
  Errno::ENETUNREACH,
54
55
  Errno::EPROTOTYPE, # IPC: existing socket file is SOCK_DGRAM, not SOCK_STREAM
55
- Socket::ResolutionError,
56
+ RESOLUTION_ERROR,
56
57
  ]
57
58
 
58
59
 
data/lib/omq/reactor.rb CHANGED
@@ -17,7 +17,9 @@ module OMQ
17
17
  #
18
18
  module Reactor
19
19
  THREAD_NAME = 'omq-io'
20
- NATIVE_FIBER_SCHEDULER = Fiber.respond_to?(:scheduler) && Fiber.method(:scheduler).source_location.nil?
20
+ NATIVE_FIBER_SCHEDULER = RUBY_ENGINE != "jruby" &&
21
+ Fiber.respond_to?(:scheduler) &&
22
+ Fiber.method(:scheduler).source_location.nil?
21
23
 
22
24
  @mutex = Mutex.new
23
25
  @pid = nil
data/lib/omq/socket.rb CHANGED
@@ -325,7 +325,7 @@ module OMQ
325
325
  @options.recv_timeout = recv_timeout if recv_timeout
326
326
  @options.conflate = conflate
327
327
  @options.on_mute = on_mute if on_mute
328
- backend_name = (backend || :ruby).to_sym
328
+ backend_name = backend ? backend.to_sym : default_backend
329
329
  if backend_name == :ruby && !Reactor.native_fiber_scheduler?
330
330
  raise NotImplementedError, "Ruby backend requires native Fiber.scheduler; use backend: :rust"
331
331
  end
@@ -342,6 +342,23 @@ module OMQ
342
342
  private
343
343
 
344
344
 
345
+ def default_backend
346
+ return :ruby if Reactor.native_fiber_scheduler?
347
+ return :rust if Backend.registered?(:rust)
348
+
349
+ begin
350
+ require_backend(:rust)
351
+ rescue LoadError => error
352
+ raise error if error.path && error.path != "omq/backend/rust"
353
+
354
+ raise NotImplementedError,
355
+ "Ruby backend requires native Fiber.scheduler; install omq-backend-rust or use backend: :rust"
356
+ end
357
+
358
+ :rust if Backend.registered?(:rust)
359
+ end
360
+
361
+
345
362
  def require_backend(name)
346
363
  path = case name
347
364
  when :libzmq then "omq/backend/libzmq"
data/lib/omq/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OMQ
4
- VERSION = "0.28.8"
4
+ VERSION = "0.28.10"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.8
4
+ version: 0.28.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger