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

add support to continue tasks #411

Closed
kaazoo opened this issue May 4, 2011 · 3 comments
Closed

add support to continue tasks #411

kaazoo opened this issue May 4, 2011 · 3 comments
Labels
Milestone

Comments

@kaazoo
Copy link

kaazoo commented May 4, 2011

With this example from minrk it is possible to requeue a stopped given task:

from IPython.parallel import Client
from IPython.parallel.utils import unpack_apply_message

rc = Client()
view = rc.load_balanced_view()

# get the buffers from the Hub
rec = rc.db_query(dict(msg_id=msg_id), keys=['buffers'])[0]
# reconstruct the arguments
f,args,kwargs = unpack_apply_message(rec['buffers'])
# resubmit
view.apply_async(f,*args,**kwargs)

However this will create a new task because it submits a copy with the same contents. If you don't want to keep old stopped tasks after you requeued them, you'll have to delete them with purge_results(msg_id).

Is there a way to keep the old tasks and just set their status to 'pending' again?

@minrk
Copy link
Member

minrk commented May 4, 2011

true task resubmision is definitely on my todo list, but not yet implemented.

That resubmit code I showed you is not meant to be the real solution, just a hack that sort of works in the meantime.

@minrk
Copy link
Member

minrk commented May 4, 2011

I went ahead and implemented a resubmit method as part of #413. If you check out that branch, you can see if it provides what you need. Pass one or more msg_ids, and the task(s) will be re-run from the Hub. No client-level db shenanigans necessary.

@kaazoo
Copy link
Author

kaazoo commented May 5, 2011

Thanks for implementing this funtionality. I'll add further feedback at #413.

@kaazoo kaazoo closed this as completed May 5, 2011
minrk added a commit to minrk/ipython that referenced this issue May 17, 2011
closes ipythongh-411

* allow `content` in session.serialize to be a unicode object, because mongo+JSON cannot be relied upon to produce encoded bytes.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
closes ipythongh-411

* allow `content` in session.serialize to be a unicode object, because mongo+JSON cannot be relied upon to produce encoded bytes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants