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.44k stars 151 forks source link

feat!: make callback opaque #1383

Closed wyfo closed 3 weeks ago

wyfo commented 3 weeks ago

Use an enum hidden to use channel senders directly. It should improve performances, and may allow later to use async sender methods.

github-actions[bot] commented 3 weeks ago

PR missing one of the required labels: {'dependencies', 'documentation', 'breaking-change', 'bug', 'enhancement', 'internal', 'new feature'}

wyfo commented 3 weeks ago

Using a immutable reference as callback argument prevent getting a mutable access to a shared memory segment contained in payload. The solutions would be either to use a mutable reference, or to keep the argument by value. @kydos said he prefer keeping the current semantic, so let's go. I will the PR accordingly.

DenisBiryukov91 commented 3 weeks ago

Using a immutable reference as callback argument prevent getting a mutable access to a shared memory segment contained in payload.

Access by value is still available through handlers if needed.

Mallets commented 3 weeks ago

Using a immutable reference as callback argument prevent getting a mutable access to a shared memory segment contained in payload. The solutions would be either to use a mutable reference, or to keep the argument by value. @kydos said he prefer keeping the current semantic, so let's go. I will the PR accordingly.

With current semantics you mean passing Sample by value?

wyfo commented 3 weeks ago

Yes

wyfo commented 3 weeks ago

Replaced by #1405