-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Labels
A-binariesArea: Related to binaries.Area: Related to binaries.C-proposalCategory: A proposal of some kind, and a request for comments.Category: A proposal of some kind, and a request for comments.
Description
What
Initial implementation and type/signature proposal for cuprated as a library.
#516.
Where
binaries/cuprated could be a double binary/library.
Another option is binaries/cuprated could be turned into a thin shell around a new library that contains the core node functionality, perhaps this would be cleaner.
Library name/location: TODO.
How
Some changes/fixes are necessary as binaries/cuprated currently assumes it is a standalone binary e.g.:
- Many types/signatures are
pub - Global
rayon,tokio,tracingusage; these will panic when initialized elsewhere - CLI handling is intermixed with the config code, this must be separated
API (wip)
//! # `cuprated` library.
/// An active `cuprated` node.
///
/// `Drop` will end the node process.
pub struct Node {/* ... */}
pub struct NodeConfig {/* ... */}
pub struct NodeEventListener {/* ... */}
impl Node {
/// Launch a new `cuprated` process.
pub fn launch(conifg: NodeConfig) -> Result<Self, Error>;
/// `Stream` of events emitted by `cuprated`.
pub fn events(&self) -> NodeEventListener;
/// Current config in use.
pub fn config(&self) -> &NodeConfig;
}
pub mod statics {
/* `binaries/cuprated/src/statics.rs` could be moved here */
}
pub mod signals {
/* `binaries/cuprated/src/signals.rs` could be moved here */
}Metadata
Metadata
Assignees
Labels
A-binariesArea: Related to binaries.Area: Related to binaries.C-proposalCategory: A proposal of some kind, and a request for comments.Category: A proposal of some kind, and a request for comments.