task model - clearification needed

Hi List, the current task model is somewhat silent about the mechanism for returning values from tasks. E.g.: Directory dir ("/tmp/"); DirectoryTaskFactory dtf = dir.createTaskFactory (); Task tsk = dtf.list ("data.dat", result); tsk.run (); tsk.wait (); We do not specify when 'result' will be available. I think it is obvious that 'result' is unspecified until wait returns indicating that the task is finished. From that on, result can be expected to be filled with the appropriate data. Another point remains open: the synchroneous list () might throw an exception (e.g. NoSuchFile). For the task version, it remains curently unspecified when that exception can be expected. It seems clear that allowing the implementation to throw the exception anytime between dtf.list and tsk.wait doe not make sense - it may then get raised in totally unrelated areas of application code, and may easily escape catching. I think the most sensible way is to require any excpetions to be raised on the task finishing call, that is wait() or cancel (). That implies that a saga implementation has to store any exception occuring earlier until these calls are used. Any comments? Best regards, Andre. - +-----------------------------------------------------------------+ | Andre Merzky | phon: +31 - 20 - 598 - 7759 | | Vrije Universiteit Amsterdam (VU) | fax : +31 - 20 - 598 - 7653 | | Dept. of Computer Science | mail: merzky@cs.vu.nl | | De Boelelaan 1083a | www: http://www.merzky.net | | 1081 HV Amsterdam, Netherlands | | +-----------------------------------------------------------------+
participants (1)
-
Andre Merzky