Skip to content
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

Finished callback #185

Closed
nierob opened this issue Apr 7, 2014 · 2 comments
Closed

Finished callback #185

nierob opened this issue Apr 7, 2014 · 2 comments

Comments

@nierob
Copy link

nierob commented Apr 7, 2014

It is a feature request then a bug report. I would like to be able to get a callback when a process is finished. It would simplify handling of background jobs. It would also allow to implement a proper load balancing if multiple background jobs may be executed in parallel.

@amoffat
Copy link
Owner

amoffat commented Dec 29, 2014

callbacks have been added to the release-1.10 branch, and used via the _done special keyword argument:

import sh

def done(p):
    print(p.exit_code)

p = sh.sleep(3, _done=done)
p.wait()

@nierob
Copy link
Author

nierob commented Dec 30, 2014

Great thanks!
Od: Andrew Moffat
Wys³ano: poniedzia³ek, 29 grudnia 2014 04:29
Do: amoffat/sh
Odpowiedz: amoffat/sh
DW: Nowacki Jedrzej
Temat: Re: [sh] Finished callback (#185)

callbacks have been added to the release-1.10 branch, and used via the _done special keyword argument:

import sh

def done(p):
print(p.exit_code)

p = sh.sleep(3, _done=done)
p.wait()

Reply to this email directly or view it on GitHubhttps://github.com//issues/185#issuecomment-68230063.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants