background-jobs-example: update to new api
This commit is contained in:
parent
4d6ee956c0
commit
aca23dd5db
|
@ -1,9 +1,9 @@
|
|||
use apub::{
|
||||
background_jobs::{client, ClientFactory, DeliverJob},
|
||||
awc::{AwcClient, SignatureConfig},
|
||||
background_jobs::{client, ClientFactory, DeliverJob},
|
||||
deliver::Activity,
|
||||
signature::Rustcrypto,
|
||||
session::{BreakerSession, RequestCountSession, SessionFactory},
|
||||
signature::Rustcrypto,
|
||||
};
|
||||
use background_jobs::{memory_storage::Storage, WorkerConfig};
|
||||
use example_types::{object_id, Note, NoteType};
|
||||
|
@ -43,7 +43,7 @@ impl ClientFactory for State {
|
|||
type Crypto = Rustcrypto;
|
||||
type Client = AwcClient<Rustcrypto>;
|
||||
|
||||
fn client(&self, crypto: &Self::Crypto) -> Self::Client {
|
||||
fn build_client(&self, crypto: &Self::Crypto) -> Self::Client {
|
||||
AwcClient::new(self.client.clone(), self.config.clone(), crypto.clone())
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ impl ClientFactory for State {
|
|||
impl SessionFactory for State {
|
||||
type Session = (RequestCountSession, BreakerSession);
|
||||
|
||||
fn session(&self) -> Self::Session {
|
||||
fn build_session(&self) -> Self::Session {
|
||||
(RequestCountSession::max(25), self.breakers.clone())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue