AsyncOperationCompletedHandler::new::<_F_> includes Send in its bounds for _F_, and I’m not sure why it does, or whether it should in fact.
For “I’m not sure why”: AsyncOperationCompletedHandler is explicitly marked !Send and !Sync, so why would its callback need to be Send?
For “I’m not sure whether it should”: my concrete use case is WebViewControl, which requires a single-threaded apartment anyway. Given that WebViewControl instantiation is done asynchronously and you can’t use blocking_get() for reasons I won’t contemplate, the Send bound on the callback is very debilitating; it actively blocks what seems to me the most likely way you want to use it.
I have not investigated in any depth, but my intuition says that IAsyncOperation would always be at least effectively single-threaded.
Have I missed something? Is there a reason why that Send bound is there?
AsyncOperationCompletedHandler::new::<_F_>includesSendin its bounds for_F_, and I’m not sure why it does, or whether it should in fact.For “I’m not sure why”:
AsyncOperationCompletedHandleris explicitly marked!Sendand!Sync, so why would its callback need to beSend?For “I’m not sure whether it should”: my concrete use case is
WebViewControl, which requires a single-threaded apartment anyway. Given thatWebViewControlinstantiation is done asynchronously and you can’t useblocking_get()for reasons I won’t contemplate, theSendbound on the callback is very debilitating; it actively blocks what seems to me the most likely way you want to use it.I have not investigated in any depth, but my intuition says that IAsyncOperation would always be at least effectively single-threaded.
Have I missed something? Is there a reason why that
Sendbound is there?