You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by DeWayne Filppi <de...@gigaspaces.com> on 2017/07/12 18:53:47 UTC

async execution/task management

I need to:

1. Launch an execution asynchronously
2. View the execution status asynchronously
3. Cancel the execution asynchronously

I'm assuming the execution id is the key linking these.  Is this kind of
operation supported by the library, or is it assumed that the caller will
manage such ( e.g. by calling synchronous library calls in their own
threads and managing the thread externally)?  If possible with the library,
is there an example?

-- DeWayne

Re: async execution/task management

Posted by DeWayne Filppi <de...@gigaspaces.com>.
I think I came up with a good enough solution for now.  The caller is a
long running process ( a web server essentially), so I added a module level
dict that maps execution id to runner and thread.  When a status or cancel
comes it, it just looks the objects up in the map and gets busy.  Of course
if the process that owns the map dies, all hell breaks loose.  I'll
ultimately need to serialize these objects in persistent storage or a
distributed in-memory store, but that's a problem for later.  Thanks.

On Thu, Jul 13, 2017 at 1:47 AM, Maxim Orlov <ma...@gigaspaces.com> wrote:

> However, note that since each process creates its own workflow_runner (and
> consequently a new engine), starting and ending the workflow_runner should
> be done from the same process.
>
> On Thu, Jul 13, 2017 at 11:39 AM Maxim Orlov <ma...@gigaspaces.com> wrote:
>
> > The execution id is indeed the linking factor between all execution
> > related operations. ARIA doesn't provide asynchronous execution based
> > operations. However, here
> > <https://github.com/apache/incubator-ariatosca/blob/
> master/aria/cli/commands/executions.py#L204>
> > you can see how ARIA runs executions in an asynchronous manner.
> >
> > On Wed, Jul 12, 2017 at 9:54 PM DeWayne Filppi <de...@gigaspaces.com>
> > wrote:
> >
> >> I need to:
> >>
> >> 1. Launch an execution asynchronously
> >> 2. View the execution status asynchronously
> >> 3. Cancel the execution asynchronously
> >>
> >> I'm assuming the execution id is the key linking these.  Is this kind of
> >> operation supported by the library, or is it assumed that the caller
> will
> >> manage such ( e.g. by calling synchronous library calls in their own
> >> threads and managing the thread externally)?  If possible with the
> >> library,
> >> is there an example?
> >>
> >> -- DeWayne
> >>
> >
>



-- 
DeWayne Filppi, Director, Solutions Architect <http://cloudify.co>
------------------------------
M: +17145121706 http://cloudify.co @dfilppi
<https://twitter.com/CloudifySource>
<https://www.linkedin.com/company-beta/17918192/>
<https://github.com/cloudify-cosmo>
<https://www.youtube.com/cloudifysource>

Re: async execution/task management

Posted by DeWayne Filppi <de...@gigaspaces.com>.
The link is to CLI code, which I was aware of.   Unlike the CLI, I don't
want to sit and wait for the threads to complete.  In a manner similar to
Cloudify, I want to launch and execution in one call, and check on it's
status at will in other calls.  I would argue that if this sort of pattern
is not supported, it should be.  Currently, the library doesn't appear to
support it, while simultaneously not exposing the information needed for
callers to support it.

-- DeWayne

On Thu, Jul 13, 2017 at 1:47 AM, Maxim Orlov <ma...@gigaspaces.com> wrote:

> However, note that since each process creates its own workflow_runner (and
> consequently a new engine), starting and ending the workflow_runner should
> be done from the same process.
>
> On Thu, Jul 13, 2017 at 11:39 AM Maxim Orlov <ma...@gigaspaces.com> wrote:
>
> > The execution id is indeed the linking factor between all execution
> > related operations. ARIA doesn't provide asynchronous execution based
> > operations. However, here
> > <https://github.com/apache/incubator-ariatosca/blob/
> master/aria/cli/commands/executions.py#L204>
> > you can see how ARIA runs executions in an asynchronous manner.
> >
> > On Wed, Jul 12, 2017 at 9:54 PM DeWayne Filppi <de...@gigaspaces.com>
> > wrote:
> >
> >> I need to:
> >>
> >> 1. Launch an execution asynchronously
> >> 2. View the execution status asynchronously
> >> 3. Cancel the execution asynchronously
> >>
> >> I'm assuming the execution id is the key linking these.  Is this kind of
> >> operation supported by the library, or is it assumed that the caller
> will
> >> manage such ( e.g. by calling synchronous library calls in their own
> >> threads and managing the thread externally)?  If possible with the
> >> library,
> >> is there an example?
> >>
> >> -- DeWayne
> >>
> >
>



-- 
DeWayne Filppi, Director, Solutions Architect <http://cloudify.co>
------------------------------
M: +17145121706 http://cloudify.co @dfilppi
<https://twitter.com/CloudifySource>
<https://www.linkedin.com/company-beta/17918192/>
<https://github.com/cloudify-cosmo>
<https://www.youtube.com/cloudifysource>

Re: async execution/task management

Posted by Maxim Orlov <ma...@gigaspaces.com>.
However, note that since each process creates its own workflow_runner (and
consequently a new engine), starting and ending the workflow_runner should
be done from the same process.

On Thu, Jul 13, 2017 at 11:39 AM Maxim Orlov <ma...@gigaspaces.com> wrote:

> The execution id is indeed the linking factor between all execution
> related operations. ARIA doesn't provide asynchronous execution based
> operations. However, here
> <https://github.com/apache/incubator-ariatosca/blob/master/aria/cli/commands/executions.py#L204>
> you can see how ARIA runs executions in an asynchronous manner.
>
> On Wed, Jul 12, 2017 at 9:54 PM DeWayne Filppi <de...@gigaspaces.com>
> wrote:
>
>> I need to:
>>
>> 1. Launch an execution asynchronously
>> 2. View the execution status asynchronously
>> 3. Cancel the execution asynchronously
>>
>> I'm assuming the execution id is the key linking these.  Is this kind of
>> operation supported by the library, or is it assumed that the caller will
>> manage such ( e.g. by calling synchronous library calls in their own
>> threads and managing the thread externally)?  If possible with the
>> library,
>> is there an example?
>>
>> -- DeWayne
>>
>

Re: async execution/task management

Posted by Maxim Orlov <ma...@gigaspaces.com>.
The execution id is indeed the linking factor between all execution related
operations. ARIA doesn't provide asynchronous execution based operations.
However, here
<https://github.com/apache/incubator-ariatosca/blob/master/aria/cli/commands/executions.py#L204>
you can see how ARIA runs executions in an asynchronous manner.

On Wed, Jul 12, 2017 at 9:54 PM DeWayne Filppi <de...@gigaspaces.com>
wrote:

> I need to:
>
> 1. Launch an execution asynchronously
> 2. View the execution status asynchronously
> 3. Cancel the execution asynchronously
>
> I'm assuming the execution id is the key linking these.  Is this kind of
> operation supported by the library, or is it assumed that the caller will
> manage such ( e.g. by calling synchronous library calls in their own
> threads and managing the thread externally)?  If possible with the library,
> is there an example?
>
> -- DeWayne
>