Expand description
Defines ConductorHandle
, a lightweight cloneable reference to a Conductor
with a limited public interface.
A ConductorHandle can be produced via ConductorBuilder
async fn async_main () {
use holochain_state::test_utils::test_db_dir;
use holochain::conductor::{Conductor, ConductorBuilder, ConductorHandle};
let env_dir = test_db_dir();
let handle: ConductorHandle = ConductorBuilder::new()
.test(env_dir.path(), &[])
.await
.unwrap();
// handles are cloneable
let handle2 = handle.clone();
assert_eq!(handle.list_dnas(), vec![]);
handle.shutdown();
The purpose of this handle is twofold:
First, it specifies how to synchronize read/write access to a single Conductor across multiple references. The various Conductor APIs - CellConductorApi, AdminInterfaceApi, and AppInterfaceApi, use a ConductorHandle as their sole method of interaction with a Conductor.
Secondly, it hides the concrete type of the Conductor behind a dyn Trait. The Conductor is a central point of configuration, and has several type parameters, used to modify functionality including specifying mock types for testing. If we did not have a way of hiding this type genericity, code which interacted with the Conductor would also have to be highly generic.
Modules
Structs
The current “production” implementation of a ConductorHandle. The implementation specifies how read/write access to the Conductor should be synchronized across multiple concurrent Handles.
Special switches for features to be used during development and testing
Specify changes to be made to the Devsettings. None means no change, Some means make the specified change.
Base trait for ConductorHandle
Traits
Base trait for ConductorHandle
Type Definitions
A list of Cells which failed to start, and why
A handle to the Conductor that can easily be passed around and cheaply cloned