|
From: | Rich Andrews |
Subject: | Re: [Fab-user] Task.run() and task decorators |
Date: | Tue, 17 Dec 2013 10:13:01 -0500 |
On Monday 16 Dec 2013 13:28:50 Rich Andrews wrote:
...
> We might be closer to answering question with this example. It appears bothWell, what I was going by is that runs_once is implemented as a memoizing
> WrappedCallableTask and the Task subclass are run() for each host present
> in the fab role being treated, though the @runs_once decorator is present.
>
> So then a more articulate question may be, "How does a Task subclass know
> the intentions of the decorators following its @task(task_class=)
> declaration?"
function, i.e. it just saves result of the wrapped callable in an attribute of
that callable, and avoids calling it when that attribute is already present.
So the Task subclass doesn't need to know anything, it's just if you wanted
the run() method to execute only once, *it* would have to be the callable
wrapped in runs_once (or be implemented in a similar way).
**********************************************************************************************
The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.
When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract.
If you have received this email in error please notify address@hidden
John Henderson (Holdings) Ltd
Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT.
Registered in Northern Ireland
Registration Number NI010588
Vat No.: 814 6399 12
*********************************************************************************
[Prev in Thread] | Current Thread | [Next in Thread] |