Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multitasking (Multi-Processing) [minor] #28

Merged
merged 108 commits into from Apr 28, 2023
Merged

Multitasking (Multi-Processing) [minor] #28

merged 108 commits into from Apr 28, 2023

Conversation

ric-evans
Copy link
Collaborator

@ric-evans ric-evans commented Apr 21, 2023

Enable multitasking, i.e. processing multiple tasks concurrently.

BREAKING CHANGE:
Users must now define the file type of the subprocess's input and output files. Previously, filepaths were defined. This change allows the files to be uniquely named. The user's cmd argument can include meta-variables {{INFILE}} and {{OUTFILE}} which are replaced for the unique filename at runtime.

closes #26

@ric-evans ric-evans added the enhancement New feature or request label Apr 21, 2023
@ric-evans ric-evans requested a review from dsschult April 21, 2023 16:33
@ric-evans ric-evans self-assigned this Apr 21, 2023
@ric-evans ric-evans requested a review from dsschult April 27, 2023 23:17
Copy link
Contributor

@dsschult dsschult left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks okay. Comments on some minor stuff.

ewms_pilot/pilot.py Show resolved Hide resolved
ewms_pilot/pilot.py Outdated Show resolved Hide resolved
ewms_pilot/pilot.py Outdated Show resolved Hide resolved
LOGGER.error("Task failed:")
LOGGER.error(_task_exception_str(task))
else:
await sub.ack(tasks[task])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why you use task.exception() instead of:

try:
  await task
except Exception:
  LOGGER.error("Task failed:")

(note that this is also how you're supposed to get the return value from the future, if you had one)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I was following examples in the docs, which used the helper methods

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be interested to know which docs?

@ric-evans ric-evans merged commit 6056971 into main Apr 28, 2023
20 checks passed
@ric-evans ric-evans deleted the multi-proc branch April 28, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-Processing
2 participants