pub struct Wora<T> {
pub app_name: String,
pub dirs: Dirs,
pub si: Arc<System>,
pub stats: Stats,
pub sender: Sender<Event<T>>,
pub receiver: Receiver<Event<T>>,
pub leadership: Leadership,
/* private fields */
}Expand description
All workloads will be able to access the WORA API
Fields§
§app_name: Stringapplication name
dirs: Dirscommon directories for all executors
si: Arc<System>statgrab handle
stats: Statslast stat collection
sender: Sender<Event<T>>Event producer
receiver: Receiver<Event<T>>Event receiver
leadership: Leadershipleadership state
Implementations§
source§impl<T: Debug + Send + Sync + 'static> Wora<T>
impl<T: Debug + Send + Sync + 'static> Wora<T>
WORA API
pub fn new( dirs: &Dirs, app_name: String, ev_buf_size: usize ) -> Result<Wora<T>, WoraSetupError>
sourcepub fn stats_from_start(&self) -> &Stats
pub fn stats_from_start(&self) -> &Stats
Examples found in repository?
examples/async_daemon.rs (line 100)
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
async fn setup(
&mut self,
wora: &Wora<()>,
exec: &(dyn Executor + Send + Sync),
fs: &LocalFS,
_metrics: &(dyn MetricProcessor + Send + Sync),
) -> Result<(), Box<dyn std::error::Error>> {
debug!("{:?}", wora.stats_from_start());
let args = DaemonArgs::parse();
self.args = args;
debug!("{:?}", exec.disable_core_dumps());
Ok(())
}pub fn dirs(&self) -> &Dirs
pub async fn emit_event(&self, ev: Event<T>)
pub fn host_os_name(&self) -> &str
pub fn host_os_version(&self) -> Option<String>
pub fn host_architecture(&self) -> Option<String>
pub fn host_hostname(&self) -> Option<String>
pub fn host_cpu_count(&self) -> usize
pub fn host_cpu_max(&self) -> usize
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Wora<T>
impl<T> Send for Wora<T>where T: Send,
impl<T> Sync for Wora<T>where T: Send,
impl<T> Unpin for Wora<T>
impl<T> !UnwindSafe for Wora<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more