Return Code Dilemma
Return Code Dilemma
- Subject: Return Code Dilemma
- From: Daniel Todd Currie <email@hidden>
- Date: Thu, 29 Apr 2004 16:00:54 -0700
Hi all, I've a rather broad design question here...
I am working on a class that does all of it's work by a single public
class method being called. The class method creates a new instance and
does a bunch of calculations and network stuff in a new thread, then
cleans up the instance it created. The created instance is completely
private. I'd like to have the class method return integer codes based
on the results of the calculations in the new thread.
The problem is that waiting for the results of the instance's thread in
the class method (which needs to be in the main thread), means that the
instance may as well be doing everything in the main thread.
Are return codes even viable in these circumstances? The instance
takes some time to do its calculations and if the network is slow, it
may take even longer. Thus there's no way of knowing when the return
code will even be available. Is a return code even useful? In this
situation, how might each of you gather this information that will
become available at an unknown time after the class method is called?
Any thoughts are appreciated, even if they may steer my project in a
different direction.
-- Daniel Currie
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.