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

Simplify keywords of RemoteProcessController.continue_process #114

Open
sphuber opened this issue Jun 4, 2019 · 2 comments
Open

Simplify keywords of RemoteProcessController.continue_process #114

sphuber opened this issue Jun 4, 2019 · 2 comments

Comments

@sphuber
Copy link
Collaborator

sphuber commented Jun 4, 2019

Currently it has nowait and no_reply. Aside from the inconsistent use of underscores, having these as negations can make it difficult when passing False resulting in a double negative. Maybe wait and reply are more intuitive.

@muhrin muhrin transferred this issue from aiidateam/kiwipy Jun 13, 2019
@muhrin
Copy link
Collaborator

muhrin commented Jun 13, 2019

I transferred this issue as it referres to plumpy.

You're right, these don't make too much sense. I used nowait as this is what RMQ uses (https://www.rabbitmq.com/amqp-0-9-1-quickref.html#confirm.select), however, given that plumpy is not a communications library I don't see any reason why we can't use more intuitive names for our context.

My feeling is that the inner create_continue_body should still continue to use the RMQ style flags though...although I'm open to being convinced otherwise.

I like wait as it is simple and what Popen does (https://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait)

As for no_reply again, this is more thinking from the communications point of view. Maybe a more intuitive name would actually be something like await_result. What do you think?

@sphuber
Copy link
Collaborator Author

sphuber commented Jun 13, 2019

My feeling is that the inner create_continue_body should still continue to use the RMQ style flags though

Agreed

Concerning the naming in RemoteProcessController. I think I first need to get straight what their exact definition is to try and come up with a sensible name. Because naming them wait and await_result will make anyone ponder: "what the hell is the difference".

The nowait flag is a property of the task message body and when set to True says that then sender of the message is not going to wait for the result of the task.
The no_reply flag is an attribute of the communicator and when set to True means that after sending the message, the function will immediately return, without waiting for a response from the receiver.

If this is correct, doesn't that mean that having nowait=False and no_reply=True doesn't make any sense. With nowait=False we are saying "we want the result from the receiver" but with no_reply=True we are saying "I am not interested in any result".

If I have all this correct, maybe we could have something like this:

  • await_response: will wait for the self._communicator.task_send to get a response
  • await_result: will wait for the receiver to return the task result
  1. If await_result=True then await_response has to be True.
  2. If await_result=False but await_response=True then the return value will be an acknowledgement from the receiver that the task was received?

Is my understanding correct?

@sphuber sphuber added this to the v0.15.0 milestone Jun 17, 2019
@sphuber sphuber modified the milestones: v0.15.0, v0.16.0 Jun 5, 2020
@sphuber sphuber removed this from the v0.17.0 milestone Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants