@mattiemMatt Massicotte How would you feel and enforce correctness in a situation like this?

I have an OpaquePointer, FSEvents C API. That's not Sendable.

I can wrap the C setup and teardown in a non-copyable struct.

The C API produces events on a dispatch queue I can control.

I want an AsyncStream of events, and the continuation needs a sendable termination handler. โ˜น๏ธ๐Ÿ‘Ž That manages lifetime.

Wrap consuming ownership in an unchecked sendable class Box for continuation? That's the smallest I came up with

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/ctietze/statuses/116040495575583185 on your instance and quote it. (Note that quoting is not supported in Mastodon.)