diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-09-25 01:05:38 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-09-25 01:05:38 -0400 |
| commit | af7ece7dd5433051d67526ae15ad64f0f5b5e568 (patch) | |
| tree | 636b0e804ea1f0fbf5675ec6d60aa7972822e821 /src/events/routes.rs | |
| parent | 0b89800d55c21aaa11d69c1dba89277cc4a46809 (diff) | |
Code organization changes considered during implementation of vector-of-sequence-numbers stream resume.
Diffstat (limited to 'src/events/routes.rs')
| -rw-r--r-- | src/events/routes.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/events/routes.rs b/src/events/routes.rs index 7731680..5181370 100644 --- a/src/events/routes.rs +++ b/src/events/routes.rs @@ -16,13 +16,12 @@ use futures::{ stream::{self, Stream, StreamExt as _, TryStreamExt as _}, }; -use super::repo::broadcast; +use super::{extract::LastEventId, repo::broadcast}; use crate::{ app::App, - channel::app::EventsError, clock::RequestedAt, error::InternalError, - header::LastEventId, + events::app::EventsError, repo::{channel, login::Login}, }; @@ -67,8 +66,8 @@ async fn events( let resume_at = resume_at.get(&channel).copied(); let events = app - .channels() - .events(&channel, &now, resume_at) + .events() + .subscribe(&channel, &now, resume_at) .await? .map(ChannelEvent::wrap(channel)); @@ -122,9 +121,6 @@ impl IntoResponse for ErrorResponse { not_found @ EventsError::ChannelNotFound(_) => { (StatusCode::NOT_FOUND, not_found.to_string()).into_response() } - resume_at @ EventsError::ResumeAtError(_) => { - (StatusCode::BAD_REQUEST, resume_at.to_string()).into_response() - } other => InternalError::from(other).into_response(), } } |
