Lasso Soft Inc. > Home

[Async]

LinkAsync
AuthorKe Carlton
CategoryAction
Version8.x
LicensePublic Domain
Posted11 Feb 2007
Updated02 May 2007
More by this author...

Description

This is a simple tag that allows any tag to be run asyncronously. It support's ctypes via the -owner property (providing the ctype is still "active"). Allows for modification of referenced variables and full logging via log_critical.

Sample Usage

Async:	-tag	= \include_url,
	-params	= array('http://www.google.com',
			-nodata),
	-log;

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define_tag:'Async',-Async,-privileged;

	handle_error;	//	log error if -log specified
		local_defined('log')?log_critical:tag_name' - 'error_currenterror;
	/handle_error;

	fail_if:!local_defined('tag'),			-2,	'Missing -tag param (escape with \\)';
	fail_if: local('tag')->type != 'tag', 	-2, '-tag requires a valid tag';
	fail_if: local_defined('params') &&  local('params')->type	!= 'array' , -2,	'-params requires an array';
	
	!local_defined('params')? local: 'params' 	= array;
	!local_defined('owner')	? local: 'owner' 	= null;

	local:'result' = #tag->run(-params=#params,-owner=#owner);
	
	//	log result if -log specified
	local_defined('log')	? log_critical:#tag' - '#result;		
	
	//	set result if -set @var supplied
	//	useful for triggering simultaneous async events
	local_defined('set')	? #set = @#result;

/define_tag;

Comments

No comments

Please log in to comment

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft