From 037d01b031789f51a3b61061435a808639bf7825 2011-04-08 00:38:56 From: MinRK Date: 2011-04-08 00:38:56 Subject: [PATCH] add shutdown to Views --- diff --git a/IPython/parallel/view.py b/IPython/parallel/view.py index 09cafce..0dfb2b7 100644 --- a/IPython/parallel/view.py +++ b/IPython/parallel/view.py @@ -276,6 +276,14 @@ class View(HasTraits): targets = self.targets return self.client.purge_results(jobs=jobs, targets=targets) + def shutdown(self, targets=None, restart=False, hub=False, block=None): + """Terminates one or more engine processes, optionally including the hub. + """ + block = self.block if block is None else block + if targets is None or targets == 'all': + targets = self.targets + return self.client.shutdown(targets=targets, restart=restart, hub=hub, block=block) + @spin_after def get_result(self, indices_or_msg_ids=None): """return one or more results, specified by history index or msg_id.