pub struct LearningEventSubscriber { /* private fields */ }Expand description
LearningEvent を受信して LearningDaemon に Record を送信
LearningEventChannel から LearningEvent を受信し、
Record に変換してバッチで LearningDaemon に送信する。
§対応 Event
LearningEvent::StrategyAdvice→StrategyAdviceRecordLearningEvent::DependencyGraphInference→DependencyGraphRecordLearningEvent::LearnStatsSnapshot→LearnStatsRecord
§使用例
ⓘ
use swarm_engine_core::events::LearningEventChannel;
use swarm_engine_core::learn::daemon::{LearningEventSubscriber, EventSubscriberConfig};
let channel = LearningEventChannel::global();
channel.enable();
let subscriber = LearningEventSubscriber::new(channel.subscribe(), record_tx);
tokio::spawn(subscriber.run());Implementations§
Source§impl LearningEventSubscriber
impl LearningEventSubscriber
Sourcepub fn new(rx: Receiver<LearningEvent>, record_tx: Sender<Vec<Record>>) -> Self
pub fn new(rx: Receiver<LearningEvent>, record_tx: Sender<Vec<Record>>) -> Self
新しい LearningEventSubscriber を作成
Sourcepub fn with_config(
rx: Receiver<LearningEvent>,
record_tx: Sender<Vec<Record>>,
config: EventSubscriberConfig,
) -> Self
pub fn with_config( rx: Receiver<LearningEvent>, record_tx: Sender<Vec<Record>>, config: EventSubscriberConfig, ) -> Self
設定を指定して LearningEventSubscriber を作成
Auto Trait Implementations§
impl Freeze for LearningEventSubscriber
impl RefUnwindSafe for LearningEventSubscriber
impl Send for LearningEventSubscriber
impl Sync for LearningEventSubscriber
impl Unpin for LearningEventSubscriber
impl UnwindSafe for LearningEventSubscriber
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more