diff --git a/src/activity_queue.rs b/src/activity_queue.rs
index 6e4ad99..31b433b 100644
--- a/src/activity_queue.rs
+++ b/src/activity_queue.rs
@@ -13,6 +13,7 @@ use crate::{
use anyhow::anyhow;
use bytes::Bytes;
+use dyn_clone::{DynClone, clone_trait_object};
use futures_core::Future;
use http::{header::HeaderName, HeaderMap, HeaderValue};
use httpdate::fmt_http_date;
@@ -96,6 +97,7 @@ where
private_key: private_key.clone(),
http_signature_compat: config.http_signature_compat,
};
+ let _ = config.outbound_storage.store_task(&message);
// Don't use the activity queue if this is in debug mode, send and wait directly
if config.debug {
@@ -259,6 +261,36 @@ pub(crate) struct ActivityQueue {
retry_sender_task: JoinHandle<()>,
}
+/// A trait for manipulating a cache of SendActivityTask
+pub trait StorageInterface: DynClone + Send {
+ /// Store an SendActivityTask to disk
+ fn store_task(&self, task: &SendActivityTask) -> Result<(), anyhow::Error>;
+
+ /// read SendActivityTask from disk
+ fn read_task(&self)->Result