Promise >> wait

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Promise >> wait

Tony Garnock-Jones-3
Hi all,

The method Promise >> wait does nothing if the promise is rejected. This
means that the waiting party waits... forever.

I suggest changing this so that wait signals some kind of BrokenPromise
exception in the case that the promise is rejected.

Is this a good idea?

It's hard to see in the image anywhere the current behavior of wait
might be being relied upon.

There are no tests for Promise>>wait in the current KernelTests.

I've submitted two proposed changes to the Inbox:

 - Kernel-tonyg.1059.mcz alters Promise>>wait per the above
 - KernelTests-tonyg.318.mcz adds tests that expect the new behavior

Cheers,
  Tony

Reply | Threaded
Open this post in threaded view
|

Re: Promise >> wait

Tobias Pape
Hey Tony,

On 17.02.2017, at 20:14, Tony Garnock-Jones <[hidden email]> wrote:

> Hi all,
>

good to hear from you!


> The method Promise >> wait does nothing if the promise is rejected. This
> means that the waiting party waits... forever.
>
> I suggest changing this so that wait signals some kind of BrokenPromise
> exception in the case that the promise is rejected.
>
> Is this a good idea?

Sounds good to me!

Best regards
        -tobias

>
> It's hard to see in the image anywhere the current behavior of wait
> might be being relied upon.
>
> There are no tests for Promise>>wait in the current KernelTests.
>
> I've submitted two proposed changes to the Inbox:
>
> - Kernel-tonyg.1059.mcz alters Promise>>wait per the above
> - KernelTests-tonyg.318.mcz adds tests that expect the new behavior
>
> Cheers,
>  Tony
>