Skip to content

Conversation

@simonpcouch
Copy link
Collaborator

Closes #63.

stderr = "|"
)
withr::defer(busy$kill())
Sys.sleep(1)
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'm not into these two Sys.sleeps, but it's not clear to me that we can infer these processes' status by calling methods on them. We need to give the sessions long enough to be ready to respond in first_responsive_session().

{
# the dial in list_r_sessions itself doesn’t prove the session is
# responsive—require the session to actually reply and then postprocess
sessions <- list_r_sessions()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My sense is that we need to run basically all of list_r_sessions() in order to actually retrieve this information we want. In theory, we're waiting on all pipes in sort(as.character(nanonext::collect_aio_(res))) to respond and we could return earlier in the first_responsive_session() case—returning when the lowest-indexed session responds regardless of the status of the others—but I don't have a strong opinion on whether this is worth the additional complexity.

Copy link
Member

@shikokuchuo shikokuchuo left a comment

Choose a reason for hiding this comment

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

I left a comment on the issue, but my sense is that if there's more than one session, we don't dispatch to a (random) one.

In that case, we'd have to try dialling the sockets (first part of list_r_sessions()) to see if more than one succeeds (dial(fail = "none") returns 0L on success and a positive integer on failure), but we wouldn't need to request/wait for any responses).

@simonpcouch
Copy link
Collaborator Author

Got it, thanks for your thoughts! I think that's reasonable—not worth the change if it's mostly geared to rare uses.

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

Successfully merging this pull request may close these issues.

don't automatically dispatch to a busy session

3 participants