From 10beaed9839a95ac76cadb3b97443080783d3b8d Mon Sep 17 00:00:00 2001 From: Pedram Rezaei Date: Thu, 17 Sep 2026 22:38:02 -0700 Subject: [PATCH 1/2] Avoid wait setup for zero-timeout Python receives --- .github/workflows/publish.yml | 5 +++-- src/python/pyproject.toml | 2 +- src/python/python/cloudtoid_interprocess/__init__.py | 2 +- src/python/src/lib.rs | 8 ++++++++ src/python/test_api.py | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1b29558..8f1c7cb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -37,8 +37,9 @@ jobs: node = json.load(open('src/node/package.json')) assert node['version'] == v assert all(value == v for value in node['optionalDependencies'].values()) - assert tomllib.load(open('src/python/pyproject.toml','rb'))['project']['version'] == v - assert f'__version__ = "{v}"' in Path('src/python/python/cloudtoid_interprocess/__init__.py').read_text() + python_version = tomllib.load(open('src/python/pyproject.toml','rb'))['project']['version'] + assert python_version == v or python_version.startswith(f'{v}.post') + assert f'__version__ = "{python_version}"' in Path('src/python/python/cloudtoid_interprocess/__init__.py').read_text() assert f'VERSION {v} LANGUAGES' in Path('src/c/CMakeLists.txt').read_text() for name in ('c', 'python', 'node'): manifest = tomllib.load(open(f'src/{name}/Cargo.toml', 'rb')) diff --git a/src/python/pyproject.toml b/src/python/pyproject.toml index 1e183a6..ea4aa66 100644 --- a/src/python/pyproject.toml +++ b/src/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "cloudtoid-interprocess" -version = "3.0.1" +version = "3.0.1.post1" description = "Fast shared-memory byte queues across Python, Rust, C, Go, Node.js, and .NET" requires-python = ">=3.9" license = "MIT" diff --git a/src/python/python/cloudtoid_interprocess/__init__.py b/src/python/python/cloudtoid_interprocess/__init__.py index b27092e..f42d81d 100644 --- a/src/python/python/cloudtoid_interprocess/__init__.py +++ b/src/python/python/cloudtoid_interprocess/__init__.py @@ -3,4 +3,4 @@ from ._native import Publisher, Subscriber __all__ = ["Publisher", "Subscriber", "InterprocessError", "CapacityMismatchError", "PublisherLimitError", "CorruptQueueError"] -__version__ = "3.0.1" +__version__ = "3.0.1.post1" diff --git a/src/python/src/lib.rs b/src/python/src/lib.rs index ca3740a..28dc4c4 100644 --- a/src/python/src/lib.rs +++ b/src/python/src/lib.rs @@ -143,6 +143,14 @@ impl Subscriber { .map_err(|_| PyValueError::new_err("timeout must be finite and nonnegative")) }) .transpose()?; + if timeout.is_some_and(|limit| limit.is_zero()) { + py.check_signals()?; + let message = self.try_receive(py)?; + if message.is_none() { + py.check_signals()?; + } + return Ok(message); + } let started = Instant::now(); loop { py.check_signals()?; diff --git a/src/python/test_api.py b/src/python/test_api.py index 32c0cf2..c73b5ae 100644 --- a/src/python/test_api.py +++ b/src/python/test_api.py @@ -19,6 +19,7 @@ def test_api(self): self.assertEqual(s.receive(timeout=0), b"a") self.assertEqual(s.receive(timeout=1), b"b") self.assertIsNone(s.receive(timeout=0.005)) + self.assertIsNone(s.receive(timeout=0)) with self.assertRaises(ValueError): s.receive(timeout=-1) with self.assertRaises(ValueError): p.try_send(b"closed") with self.assertRaises(ValueError): s.try_receive() From fddb58e4cbbba87c3a8a1eba586b4e837897e95b Mon Sep 17 00:00:00 2001 From: Pedram Rezaei Date: Thu, 17 Sep 2026 23:16:31 -0700 Subject: [PATCH 2/2] Use normal 3.0.2 patch release and restore version checks --- .github/workflows/publish.yml | 5 ++--- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- src/c/CMakeLists.txt | 2 +- src/c/Cargo.toml | 2 +- src/node/Cargo.toml | 2 +- src/node/package.json | 12 ++++++------ src/python/Cargo.toml | 2 +- src/python/pyproject.toml | 2 +- src/python/python/cloudtoid_interprocess/__init__.py | 2 +- 10 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8f1c7cb..1b29558 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -37,9 +37,8 @@ jobs: node = json.load(open('src/node/package.json')) assert node['version'] == v assert all(value == v for value in node['optionalDependencies'].values()) - python_version = tomllib.load(open('src/python/pyproject.toml','rb'))['project']['version'] - assert python_version == v or python_version.startswith(f'{v}.post') - assert f'__version__ = "{python_version}"' in Path('src/python/python/cloudtoid_interprocess/__init__.py').read_text() + assert tomllib.load(open('src/python/pyproject.toml','rb'))['project']['version'] == v + assert f'__version__ = "{v}"' in Path('src/python/python/cloudtoid_interprocess/__init__.py').read_text() assert f'VERSION {v} LANGUAGES' in Path('src/c/CMakeLists.txt').read_text() for name in ('c', 'python', 'node'): manifest = tomllib.load(open(f'src/{name}/Cargo.toml', 'rb')) diff --git a/Cargo.lock b/Cargo.lock index f595ed0..f552549 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,7 +16,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cloudtoid-interprocess" -version = "3.0.1" +version = "3.0.2" dependencies = [ "libc", "windows-sys", @@ -24,14 +24,14 @@ dependencies = [ [[package]] name = "cloudtoid-interprocess-ffi" -version = "3.0.1" +version = "3.0.2" dependencies = [ "cloudtoid-interprocess", ] [[package]] name = "cloudtoid-interprocess-node" -version = "3.0.1" +version = "3.0.2" dependencies = [ "cloudtoid-interprocess", "napi", @@ -41,7 +41,7 @@ dependencies = [ [[package]] name = "cloudtoid-interprocess-python" -version = "3.0.1" +version = "3.0.2" dependencies = [ "cloudtoid-interprocess", "pyo3", diff --git a/Cargo.toml b/Cargo.toml index 6553fd6..5fec4cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["src/rust", "src/c", "src/python", "src/node"] resolver = "2" [workspace.package] -version = "3.0.1" +version = "3.0.2" edition = "2021" license = "MIT" repository = "https://github.com/cloudtoid/interprocess" diff --git a/src/c/CMakeLists.txt b/src/c/CMakeLists.txt index d3f8378..c036b31 100644 --- a/src/c/CMakeLists.txt +++ b/src/c/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.20) -project(cloudtoid_interprocess VERSION 3.0.1 LANGUAGES C) +project(cloudtoid_interprocess VERSION 3.0.2 LANGUAGES C) include(GNUInstallDirs) find_program(CARGO_EXECUTABLE cargo REQUIRED) get_filename_component(REPO_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../.." ABSOLUTE) diff --git a/src/c/Cargo.toml b/src/c/Cargo.toml index 9d9260f..623beac 100644 --- a/src/c/Cargo.toml +++ b/src/c/Cargo.toml @@ -14,4 +14,4 @@ name = "cloudtoid_interprocess" crate-type = ["cdylib", "staticlib"] [dependencies] -core-queue = { package = "cloudtoid-interprocess", path = "../rust", version = "3.0.1" } +core-queue = { package = "cloudtoid-interprocess", path = "../rust", version = "3.0.2" } diff --git a/src/node/Cargo.toml b/src/node/Cargo.toml index 0891356..45723e8 100644 --- a/src/node/Cargo.toml +++ b/src/node/Cargo.toml @@ -12,7 +12,7 @@ doctest = false crate-type = ["cdylib"] [dependencies] -core-queue = { package = "cloudtoid-interprocess", path = "../rust", version = "3.0.1" } +core-queue = { package = "cloudtoid-interprocess", path = "../rust", version = "3.0.2" } # Native calls are synchronous; JS handles waiting. No N-API thread-safe # callback/GC dispatcher is needed (enabled by napi4 and later). napi = { version = "3", default-features = false, features = ["napi3"] } diff --git a/src/node/package.json b/src/node/package.json index e273475..f2bb316 100644 --- a/src/node/package.json +++ b/src/node/package.json @@ -1,6 +1,6 @@ { "name": "@cloudtoid/interprocess", - "version": "3.0.1", + "version": "3.0.2", "description": "Fast shared-memory byte queues across Node.js, Rust, C, Go, Python, and .NET", "main": "index.js", "types": "index.d.ts", @@ -25,11 +25,11 @@ "test": "node --test test.js" }, "optionalDependencies": { - "@cloudtoid/interprocess-darwin-arm64": "3.0.1", - "@cloudtoid/interprocess-darwin-x64": "3.0.1", - "@cloudtoid/interprocess-linux-x64": "3.0.1", - "@cloudtoid/interprocess-win32-x64": "3.0.1", - "@cloudtoid/interprocess-linux-arm64": "3.0.1" + "@cloudtoid/interprocess-darwin-arm64": "3.0.2", + "@cloudtoid/interprocess-darwin-x64": "3.0.2", + "@cloudtoid/interprocess-linux-x64": "3.0.2", + "@cloudtoid/interprocess-win32-x64": "3.0.2", + "@cloudtoid/interprocess-linux-arm64": "3.0.2" }, "exports": { ".": { diff --git a/src/python/Cargo.toml b/src/python/Cargo.toml index c468357..792df65 100644 --- a/src/python/Cargo.toml +++ b/src/python/Cargo.toml @@ -14,7 +14,7 @@ name = "_native" crate-type = ["cdylib"] [dependencies] -core-queue = { package = "cloudtoid-interprocess", path = "../rust", version = "3.0.1" } +core-queue = { package = "cloudtoid-interprocess", path = "../rust", version = "3.0.2" } pyo3 = { version = "0.29", features = ["extension-module", "abi3-py39"] } [build-dependencies] diff --git a/src/python/pyproject.toml b/src/python/pyproject.toml index ea4aa66..da75f21 100644 --- a/src/python/pyproject.toml +++ b/src/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "cloudtoid-interprocess" -version = "3.0.1.post1" +version = "3.0.2" description = "Fast shared-memory byte queues across Python, Rust, C, Go, Node.js, and .NET" requires-python = ">=3.9" license = "MIT" diff --git a/src/python/python/cloudtoid_interprocess/__init__.py b/src/python/python/cloudtoid_interprocess/__init__.py index f42d81d..5ae8a93 100644 --- a/src/python/python/cloudtoid_interprocess/__init__.py +++ b/src/python/python/cloudtoid_interprocess/__init__.py @@ -3,4 +3,4 @@ from ._native import Publisher, Subscriber __all__ = ["Publisher", "Subscriber", "InterprocessError", "CapacityMismatchError", "PublisherLimitError", "CorruptQueueError"] -__version__ = "3.0.1.post1" +__version__ = "3.0.2"