Re: How best to do async functions and XPCOM?

2020-01-08 Thread Kris Maglione
On Thu, Dec 12, 2019 at 09:30:06AM -0500, Boris Zbarsky wrote: On 12/10/19 3:31 PM, Kris Maglione wrote: In what way is dom::Promise annoying to use from C++? The one thing I know about that's pretty annoying is if you receive the promise from someone else and want to add reactions to it.

Re: How best to do async functions and XPCOM?

2019-12-16 Thread Boris Zbarsky
On 12/10/19 3:31 PM, Kris Maglione wrote: In what way is dom::Promise annoying to use from C++? The one thing I know about that's pretty annoying is if you receive the promise from someone else and want to add reactions to it. PromiseNativeHandler kinda works, but then you get JS::Values and

Re: How best to do async functions and XPCOM?

2019-12-12 Thread Geoff Lankow
Thanks to all who replied, including Kris whose reply seems to have not made it back to the list. As per usual when I ask for help I've been immediately distracted by something more urgent and not got back to the problem at hand. :-/ As some pointed out this would be a lot easier if I was

Re: How best to do async functions and XPCOM?

2019-12-12 Thread Kris Maglione
On Sun, Dec 08, 2019 at 11:40:52PM -0500, Joshua Cranmer  wrote: The problem with MozPromise is that it doesn't integrate well if you use XPIDL interfaces, so you have this annoying issue that if you want to use XPIDL integration, you have to use mozilla::dom::Promise, which is annoying to

Re: How best to do async functions and XPCOM?

2019-12-12 Thread Andreas Tolfsen
Also sprach Joshua Cranmer: > The problem with MozPromise is that it doesn't integrate well if you use > XPIDL interfaces, so you have this annoying issue that if you want to use > XPIDL integration, you have to use mozilla::dom::Promise, which is annoying > to use from C++. A third wrinkle,

Re: How best to do async functions and XPCOM?

2019-12-12 Thread Kris Maglione
On Fri, Dec 06, 2019 at 11:20:12AM +1300, Geoff Lankow wrote: Hi all I'm redesigning a bunch of Thunderbird things to be asynchronous. I'd like to use Promises but a lot of the time I'll be far from a JS context so that doesn't really seem like an option. The best alternative I've come up

Re: How best to do async functions and XPCOM?

2019-12-09 Thread Joshua Cranmer 
On 12/5/2019 6:33 PM, Gerald Squelart wrote: On Friday, December 6, 2019 at 9:20:21 AM UTC+11, Geoff Lankow wrote: Hi all I'm redesigning a bunch of Thunderbird things to be asynchronous. I'd like to use Promises but a lot of the time I'll be far from a JS context so that doesn't really seem

How best to do async functions and XPCOM?

2019-12-06 Thread Geoff Lankow
Hi all I'm redesigning a bunch of Thunderbird things to be asynchronous. I'd like to use Promises but a lot of the time I'll be far from a JS context so that doesn't really seem like an option. The best alternative I've come up with is to create some sort of listener object and pass it to

Re: How best to do async functions and XPCOM?

2019-12-06 Thread saschanaz7
On Friday, December 6, 2019 at 7:20:21 AM UTC+9, Geoff Lankow wrote: > Hi all > > I'm redesigning a bunch of Thunderbird things to be asynchronous. I'd > like to use Promises but a lot of the time I'll be far from a JS context > so that doesn't really seem like an option. The best alternative

Re: How best to do async functions and XPCOM?

2019-12-06 Thread Boris Zbarsky
On 12/5/19 5:20 PM, Geoff Lankow wrote: I'm redesigning a bunch of Thunderbird things to be asynchronous. I'd like to use Promises but a lot of the time I'll be far from a JS context Is that because both the implementation of the API and the consumer of the API will be C++? For what it's

Re: How best to do async functions and XPCOM?

2019-12-06 Thread Gerald Squelart
On Friday, December 6, 2019 at 9:20:21 AM UTC+11, Geoff Lankow wrote: > Hi all > > I'm redesigning a bunch of Thunderbird things to be asynchronous. I'd > like to use Promises but a lot of the time I'll be far from a JS context > so that doesn't really seem like an option. The best alternative