AsAsync

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

AsAsync

Justin Purdie
Wondering if anyone has had any experience using the AsAsync tag.

Inside a tag we're experiencing some severe slowness when calling the
IncludeURL(some_IP_address); to a separate server. So we are wanting to
have the include_url tag called asynchronously... but when executing:
{include_url(some_IP_address)}->asAsync(); ...nothing executes. Are we just
calling this wrong? Any thoughts? Not sure if upgrading to 8.6 had any
effects to this, but this slowness started happening around our upgrade.

Thanks in advance.


Justin Purdie
SkyVantage Development
US Ph. +1-801-649-2925 option 305
US Fax. +1-419-828-6643
Skype (Calls only - no chat): skyvantage
Email: [hidden email]
twitter:  http://twitter.com/skyvantage
facebook: http://www.facebook.com/SkyVantage

---
This message may contain confidential and/or privileged information of
SkyVantage Corporation and  its affiliated companies.  If you are not the
intended recipient, please (i) do not disclose,  copy, distribute, or use
this information, (ii) advise the sender by return e-mail, and (iii)
delete  all copies from your computer.  Your cooperation is greatly
appreciated.
#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

RE: AsAsync

Daniel Logue
Hi Justin,

Async threads are fun to troubleshoot, because it's hard to "see" what happens in them.  They have a hard time writing to files (because they don't have a relative path), and they rely on variables/params that are in their own scope.  All that being said, this should get you close:

[

{

        var(
                'response'
        );
       
        $response = include_url(
                params->first
        );
       
        email_send(
                -from ='[hidden email]',
                -to ='[hidden email]',
                -subject ='debug: asAsync include_url',
                -body =(params->first+'\r\n'$response)
        );

}->asAsync(-params=array('http://www.google.com'));

]

In this example, I'm passing in the full URL I want to hit, and referencing it inside of the async thread using the params array.  I'm only passing in one param, so I can easily access it using params->first.

A much easier way (at least for my brain) is to define a tag that runs asynchronously.  I find it easier to pass-in/use variables in that application.

Hope that helps,
Daniel Logue

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Justin Purdie
Sent: Monday, February 27, 2012 10:21 AM
To: [hidden email]
Subject: AsAsync

Wondering if anyone has had any experience using the AsAsync tag.

Inside a tag we're experiencing some severe slowness when calling the IncludeURL(some_IP_address); to a separate server. So we are wanting to have the include_url tag called asynchronously... but when executing:
{include_url(some_IP_address)}->asAsync(); ...nothing executes. Are we just calling this wrong? Any thoughts? Not sure if upgrading to 8.6 had any effects to this, but this slowness started happening around our upgrade.

Thanks in advance.


Justin Purdie
SkyVantage Development
US Ph. +1-801-649-2925 option 305
US Fax. +1-419-828-6643
Skype (Calls only - no chat): skyvantage
Email: [hidden email]
twitter:  http://twitter.com/skyvantage
facebook: http://www.facebook.com/SkyVantage

---
This message may contain confidential and/or privileged information of SkyVantage Corporation and  its affiliated companies.  If you are not the intended recipient, please (i) do not disclose,  copy, distribute, or use this information, (ii) advise the sender by return e-mail, and (iii) delete  all copies from your computer.  Your cooperation is greatly appreciated.
#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: AsAsync

Johan Solve
Globals are useful when debugging async code. Log by inserting to a
global array, watch the global on another page.

2012/2/28 Daniel Logue <[hidden email]>:

> Hi Justin,
>
> Async threads are fun to troubleshoot, because it's hard to "see" what happens in them.  They have a hard time writing to files (because they don't have a relative path), and they rely on variables/params that are in their own scope.  All that being said, this should get you close:
>
> [
>
> {
>
>        var(
>                'response'
>        );
>
>        $response = include_url(
>                params->first
>        );
>
>        email_send(
>                -from           ='[hidden email]',
>                -to             ='[hidden email]',
>                -subject        ='debug: asAsync include_url',
>                -body           =(params->first+'\r\n'$response)
>        );
>
> }->asAsync(-params=array('http://www.google.com'));
>
> ]
>
> In this example, I'm passing in the full URL I want to hit, and referencing it inside of the async thread using the params array.  I'm only passing in one param, so I can easily access it using params->first.
>
> A much easier way (at least for my brain) is to define a tag that runs asynchronously.  I find it easier to pass-in/use variables in that application.
>
> Hope that helps,
> Daniel Logue
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Justin Purdie
> Sent: Monday, February 27, 2012 10:21 AM
> To: [hidden email]
> Subject: AsAsync
>
> Wondering if anyone has had any experience using the AsAsync tag.
>
> Inside a tag we're experiencing some severe slowness when calling the IncludeURL(some_IP_address); to a separate server. So we are wanting to have the include_url tag called asynchronously... but when executing:
> {include_url(some_IP_address)}->asAsync(); ...nothing executes. Are we just calling this wrong? Any thoughts? Not sure if upgrading to 8.6 had any effects to this, but this slowness started happening around our upgrade.
>
> Thanks in advance.
>
>
> Justin Purdie
> SkyVantage Development
> US Ph. +1-801-649-2925 option 305
> US Fax. +1-419-828-6643
> Skype (Calls only - no chat): skyvantage
> Email: [hidden email]
> twitter:  http://twitter.com/skyvantage
> facebook: http://www.facebook.com/SkyVantage
>
> ---
> This message may contain confidential and/or privileged information of SkyVantage Corporation and  its affiliated companies.  If you are not the intended recipient, please (i) do not disclose,  copy, distribute, or use this information, (ii) advise the sender by return e-mail, and (iii) delete  all copies from your computer.  Your cooperation is greatly appreciated.
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



--
Mvh
Johan Sölve
____________________________________
Montania System AB
Halmstad   Stockholm
http://www.montania.se

Johan Sölve
Mobil +46 709-51 55 70
[hidden email]

Kristinebergsvägen 17, S-302 41 Halmstad, Sweden
Telefon +46 35-136800 |  Fax +46 35-136801
#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>