djinni
djinni copied to clipboard
future<void>
Currently future<> type requires a non-void type, because void is not a valid Djinni type. This means the IDL cannot represent a future with no value, but only a completion status.
+1, this is quite awkward without
- The C++
Futurecan already supportFuture<void> - Java has
java.lang.Voidthat can be used to box a void value. - What is ObjC's equivalent of
java.lang.Void? - Javascript
Promisealso already supportsPromise<void>.
Seems like everything is easy except obj-c. I don't think they have a boxed version of void. Do you need a boxed type? Maybe NSValue or a void* or something? What are the constraints?
Hi,
In obj-c you have type id:
https://riptutorial.com/objective-c/example/16005/id
I don't know if it help.
The java.lang.Void can be integer?
https://stackoverflow.com/questions/10839042/what-is-the-difference-between-java-lang-void-and-void
Thanks.
For Objective-C, maybe NSNull?
NSNull is the only option for objc I guess since we can't put void in box
to get the full value of https://github.com/Snapchat/djinni/pull/116 we really need to get a void type, otherwise it's painful to interop coroutines that return void with djinni futures that can't