-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Given a CallFuture object, it would be useful to be able to retrieve submission information (e.g. the args and kwargs that were submitted for the given CallFuture). These could be used for reporting results and errors to the user, and avoid writing boilerplate code for storing these states elsewhere.
Workaround no. 1: in addition to storing each CallFuture, we store a mapping from CallFuture to custom SubmissionInfo objects. The latter contains details about the task submission.
Workaround no. 2: we create a new attribute on each CallFuture instance using HasTraits.add_trait(). That attribute contains the submission info, which can be accessed when the task is finished. (The attribute cannot be set as usual. CallFuture inherits from the HasStrictTraits class, which prevents exactly that.)
Half-workaround (assuming exceptions are not used): modify the submitted function to also return its input parameters. This doesn’t work if the input parameters are needed for reporting errors too.