[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] How to use parallel execution via API
From: |
Jeff Forcier |
Subject: |
Re: [Fab-user] How to use parallel execution via API |
Date: |
Sun, 15 Jul 2012 15:42:07 -0700 |
On Sun, Jul 15, 2012 at 3:31 PM, Mohamed Lrhazi <address@hidden> wrote:
> Is this possible? I went through the docs and it does not show any
> examples of such usage, only via command line or a decorator.
It could be more explicit, but it's in there if you read carefully :)
http://docs.fabfile.org/en/1.4.3/usage/parallel.html#command-line-flags
"One may also force all tasks to run in parallel by using the
command-line flag -P or the env variable env.parallel."
So you can tickle env.parallel directly or via 'with settings', and
then task executions via execute() will run in parallel. E.g.:
with settings(parallel=True):
execute(mytaskfunction, hosts=[...])
In addition, decorators are simply functions themselves and can be
used to temporarily wrap otherwise un-decorated functions, so you
could also:
execute(parallel(mytaskfunction), hosts=[...])
Hope that helps,
Jeff
>
> Is there a way?
>
> Thanks a lot,
> Mohamed.
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fab-user
--
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org