Skip to content

with_session()

Create a session and destroy it when it goes out of scope.

with_session(f=nothing)

Description

This function allows you to start a session and have it automatially destroyed when a block of code completes running or errors out.

Required Parameters

f

Function to execute

Optional Parameters

This function accepts all the same parameters as start_session.

end_session_on_error (Bool)

Indicates whether the session should get ended on error. Defaults to true.

end_session_on_exit (Bool)

Indicates whether the session should get ended on exit. Defaults to true.

Example Usage

with_session(
    cluster_name = "mlexperimentation",
    nworkers = 8,
    banyanfile_path = "file://res/Banyanfile.json",
) do s
    # Computation here...
    # 
    # See banyancomputing.com/banyan-arrays-jl-docs for examples
    # of functions that you could call here.
end