Skip to content

add .expr= arg to launch_*() #541

@r2evans

Description

@r2evans

Stemming from #539, if we add one or more connections, it would be good to be able to run a starting expression on them before they are passed new tasks.

Consider this:

daemons(4, idletime=300)
everywhere(library(dplyr))
# oops, I really need more connections
launch_local(4)

In the current state, some have dplyr loaded and some do not. In this case it is trivial to call everywhere(library(dplyr)) again, but it's not hard to imagine either due to time, bandwidth/serialization, or some other reason that we would not want to re-everything() to all connections, just to the new connections.

Options:

  • launch_*(.expr=) so that the new connections are established and the .expression is executed immediately
  • add the ability to subset the connections somehow, which requires both (a) ability to request the "id" (or whatever) of each connection, and (b) pass the list of ids to everywhere()

As a hack, if I were using ssh_config(), perhaps I might play around with rscript= so that it loads R with an initial expression. Not sure if that would actually work, but ... I'm not currently using ssh_config().

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions