pub struct EventProcessor {
pub homeserver: Homeserver,
pub files_path: PathBuf,
pub tracer_name: String,
pub moderation: Moderation,
/* private fields */
}Fields§
§homeserver: Homeserver§files_path: PathBuf§tracer_name: String§moderation: ModerationImplementations§
Source§impl EventProcessor
impl EventProcessor
Sourcepub async fn test(homeserver_id: String) -> Self
pub async fn test(homeserver_id: String) -> Self
Creates a new EventProcessor instance for testing purposes.
This function initializes an EventProcessor configured with:
- A mock homeserver constructed using the provided
homeserver_urlandhomeserver_pubky. - A default configuration, including an HTTP client, a limit of 1000 events, and a sender channel.
It is designed for use in integration tests, benchmarking scenarios, or other test environments
where a controlled and predictable EventProcessor instance is required.
§Parameters
homeserver_id: AStringrepresenting the URL of the homeserver to be used in the test environment.tx: ARetryManagerSenderChannelused to handle outgoing messages or events.
pub async fn from_config(config: &WatcherConfig) -> Result<Self, DynError>
pub async fn run(&mut self) -> Result<(), DynError>
Sourcepub async fn process_event_lines(
&mut self,
lines: Vec<String>,
) -> Result<(), DynError>
pub async fn process_event_lines( &mut self, lines: Vec<String>, ) -> Result<(), DynError>
Processes a batch of event lines retrieved from the homeserver.
This function iterates over a vector of event URIs, handling each line based on its content:
- Lines starting with
cursor:update the cursor for the homeserver and save it to the index. - Other lines are parsed into events and processed accordingly. If parsing fails, an error is logged.
§Parameters
lines: A vector of strings representing event lines retrieved from the homeserver.
Auto Trait Implementations§
impl Freeze for EventProcessor
impl RefUnwindSafe for EventProcessor
impl Send for EventProcessor
impl Sync for EventProcessor
impl Unpin for EventProcessor
impl UnsafeUnpin for EventProcessor
impl UnwindSafe for EventProcessor
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request