Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(spooler): Add EnvelopeStack based on SQLite #3855

Merged
merged 24 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions migrations/20240724144200_change_index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP INDEX IF EXISTS project_keys;

CREATE INDEX IF NOT EXISTS project_keys_received_at ON envelopes (own_key, sampling_key, received_at);
iambriccardo marked this conversation as resolved.
Show resolved Hide resolved
16 changes: 16 additions & 0 deletions relay-server/src/services/spooler/envelope_stack/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use crate::envelope::Envelope;

mod sqlite;

pub trait EnvelopeStack {
type Error;

#[allow(dead_code)]
async fn push(&mut self, envelope: Box<Envelope>) -> Result<(), Self::Error>;

#[allow(dead_code)]
async fn peek(&mut self) -> Result<&Box<Envelope>, Self::Error>;

#[allow(dead_code)]
async fn pop(&mut self) -> Result<Box<Envelope>, Self::Error>;
}
Loading
Loading