Skip to content

Support Isolate.addOnExitListener #20828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nex3 opened this issue Sep 5, 2014 · 18 comments
Closed

Support Isolate.addOnExitListener #20828

nex3 opened this issue Sep 5, 2014 · 18 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-isolate P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Milestone

Comments

@nex3
Copy link
Member

nex3 commented Sep 5, 2014

As "pub run" moves to Isolates rather than spawning processes directly, it needs to be able to track an isolate's lifecycle. Currently the Isolate.addOnExitListener function exists, but throws an UnsupportedError. This function or something like it will very soon be necessary for pub.

@DartBot
Copy link

DartBot commented Sep 6, 2014

This comment was originally written by @zoechi


I also tried to find a solution for this.
Some discussions:

@lrhn
Copy link
Member

lrhn commented Sep 6, 2014

cc @iposva-google.

@kasperl
Copy link

kasperl commented Sep 11, 2014

Added this to the 1.7 milestone.

@lrhn
Copy link
Member

lrhn commented Sep 16, 2014

Removed Area-Library label.
Added Area-VM label.

@DartBot
Copy link

DartBot commented Sep 30, 2014

This comment was originally written by [email protected]


On which platforms are the kill() and addOnExitListener() supported (i.e. why are they declared in the class at all if nothing supports them)? I would be willing to attempt to implement them, at least for OS X and maybe Linux, if I had a bit of direction as to what needs to be done to make them work.

@DartBot
Copy link

DartBot commented Sep 30, 2014

This comment was originally written by [email protected]


Ah, those methods seem to be supported on exactly zero platforms: https://github.com/dart-lang/bleeding_edge/blob/59d02fbda66c0cf4cf4f97fbb0db44759a7b6f30/dart/runtime/lib/isolate_patch.dart#L344. Sad.

@lrhn
Copy link
Member

lrhn commented Sep 30, 2014

The methods are are implemented by dart2js.

@kasperl
Copy link

kasperl commented Oct 1, 2014

Removed this from the 1.7 milestone.
Added this to the 1.8 milestone.

@lrhn
Copy link
Member

lrhn commented Oct 1, 2014

The removeOnExitListener should also be implemented with the addOnExitListener.

@iposva-google
Copy link
Contributor

Removed this from the 1.8 milestone.
Added this to the 1.9 milestone.

@sgjesse
Copy link
Contributor

sgjesse commented Nov 13, 2014

Marked this as blocking #21599.

@nex3
Copy link
Member Author

nex3 commented Dec 8, 2014

Marked this as blocking #21821.

@DartBot
Copy link

DartBot commented Dec 8, 2014

This comment was originally written by @zoechi


see also http://dartbug.com/6945

@DartBot
Copy link

DartBot commented Jan 3, 2015

This comment was originally written by @kaendfinger


Also a note, how will this be handled with Isolate.current? I assume it will throw an exception?

@lrhn
Copy link
Member

lrhn commented Jan 3, 2015

There is currently no special handling for the isolate returned by Isolate.current. It doesn't know that it refers to its own isolate (and since you can, in some cases, send an Isolate object to another isolate, it shouldn't assume it either).

So, you can set yourself up to listen for your own exit - obviously you'll never see the event, if for no other reason then because your receive port will keep the isolate alive.

@DartBot
Copy link

DartBot commented Jan 3, 2015

This comment was originally written by @kaendfinger


Ok. I know that Isolate.current.kill() works so it seems to mostly work :)

@sethladd
Copy link
Contributor

Marked this as blocking #22067.

@kevmoo
Copy link
Member

kevmoo commented Feb 18, 2015

Set owner to @sgjesse.

@nex3 nex3 added Type-Enhancement P1 A high priority bug; for example, a single project is unusable or has many test failures library-isolate area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Feb 18, 2015
@nex3 nex3 added this to the 1.9 milestone Feb 18, 2015
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-isolate P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

8 participants