eclipse-zenoh / zenoh

zenoh unifies data in motion, data in-use, data at rest and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.
https://zenoh.io
Other
1.37k stars 141 forks source link

fix: cover the zero capacity case of the handlers #1231

Closed YuanYuYuan closed 1 week ago

YuanYuYuan commented 2 weeks ago

Closes #1230

wyfo commented 1 week ago

flume supports bounded channel with a capacity of zero. It's called a "rendez-vous" channel. Even if I don't think any user would want to use that for their handlers, I agree with Luca that changing the semantic depending on the capacity being zero is not a Rust thing.

The "trick" we are using for C may be regarded as a specific C thing, but we can also choose to either expose an additional zc_reply_fifo_new_unbounded, or change the signature to accept isize with a negative value meaning unbounded. And after consideration, knowing that a capacity of zero is supported as "rendez-vous", I think that -1 would be better.

YuanYuYuan commented 1 week ago

I agree. Let's close this PR and discuss this issue in zenoh-c. https://github.com/eclipse-zenoh/zenoh-c/issues/528