Function brane_cli::run::initialize_instance
source · pub async fn initialize_instance<O: Write, E: Write>(
stdout_writer: O,
stderr_writer: E,
drv_endpoint: impl AsRef<str>,
pindex: Arc<Mutex<PackageIndex>>,
dindex: Arc<Mutex<DataIndex>>,
user: Option<String>,
attach: Option<AppId>,
options: ParserOptions,
) -> Result<InstanceVmState<O, E>, Error>
Expand description
Initializes the state for an instance VM.
This implements most of initialize_instance_vm()
, which we separate to have some clients (*cough* IDE *cough*) able to create a VM while sharing an index.
§Arguments
stdout_writer
: SomeWrite
-handle that we use to write stdout to.stderr_writer
: SomeWrite
-handle that we use to write stderr to.drv_endpoint
: Thebrane-drv
endpoint that we will connect to to run stuff.pindex
: ThePackageIndex
that contains the remote’s available packages.dindex
: TheDataIndex
that contains the remote’s available datasets.user
: Some (tentative) identifier of the user who might receive the end result.attach
: If given, we will try to attach to a session with that ID. Otherwise, we start a new session.options
: The ParserOptions that describe how to parse the given source.
§Returns
A new InstanceVmState
that represents the initialized VM.
§Errors
This function may error if we failed to reach the remote driver, or if the given session did not exist.