On 5/2/05, Steve Dworman <[EMAIL PROTECTED]> wrote:
> i am really inexperienced with these event gateways. however, i have gotten
> the simple example of the concurrency library to work. what i want to test
> is passing a value back and forth. how do i do that?
Just so folk know, the 1.1 release of the Concurrency library will
support passing arguments into the method call.
The workaround for now (and in fact the design that Java uses) is to
construct your callable CFC with the data you'd want as arguments and
then in your call() method you would have access to that data in
variables scope.
In other words, instead of:
<cfset test = createObject("component","Test")>
<cfset future = createObject("component","Concurrency.FutureTask").init(test)>
-- want to pass arguments here but 1.0 library does not allow <cfset
future.run(arg1,arg2)>
<cfset future.run()>
<cfset result = future.get()>
<cfoutput>The result was #result#.</cfoutput>
You can do this:
<cfset test = createObject("component","Test").init(arg1,arg2)>
<cfset future = createObject("component","Concurrency.FutureTask").init(test)>
-- now run() invokes call() and call() can see arg1,arg2 in variables scope
<cfset future.run()>
<cfset result = future.get()>
<cfoutput>The result was #result#.</cfoutput>
I'm going to try to get the 1.1 release out within a week.
The README for 1.1 currently has:
Release 1.1 2005-04-?? Departed from the exact Java 5 specifications;
Deprecated
Callable; Allowed any method to be
called on the
task object; Made result optional
by allowing a
fixed result to be specified;
You can now
cancel() a running task if it has
a stop()
method - and it subsequently calls
stopped() on
the FutureTask object; Added
documentation
on the exception model; Added
more vertical
whitespace in the code to appease
Paul Kenney;
Added Throws spec to hints; Fixed
a timing issue
in waitForResult().
My TODO file currently has:
These are things I'm considering implementing in future releases:
Implement runAndReset().
Consider an install CFM page that uses the CF Admin API to set up the gateway.
Allow arguments to be specified for the asynchronous method call.
Add some samples.
--
Sean A Corfield -- http://corfield.org/
Team Fusebox -- http://fusebox.org/
Got Gmail? -- I have 50, yes 50, invites to give away!
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205337
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54