pub struct PoliciesRepo { /* private fields */ }Expand description
PostgreSQL repository for queue execution policies.
§Examples
use azums::PoliciesRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let policies = PoliciesRepo::new(pool);
let _ = policies;Implementations§
Source§impl PoliciesRepo
§Examples
use azums::PoliciesRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let policies = PoliciesRepo::new(pool);
let _ = policies;
impl PoliciesRepo
§Examples
use azums::PoliciesRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let policies = PoliciesRepo::new(pool);
let _ = policies;Sourcepub fn new(pool: Pool<Postgres>) -> PoliciesRepo
pub fn new(pool: Pool<Postgres>) -> PoliciesRepo
Creates a policy repository backed by pool.
§Examples
use azums::PoliciesRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let policies = PoliciesRepo::new(pool);
let _ = policies;Sourcepub async fn get_policy(
&self,
queue: &str,
) -> Result<Option<QueuePolicy>, Error>
pub async fn get_policy( &self, queue: &str, ) -> Result<Option<QueuePolicy>, Error>
Returns the policy configured for queue, if one exists.
§Examples
use azums::PoliciesRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let policies = PoliciesRepo::new(pool);
let _ = policies;Sourcepub async fn upsert_policy(
&self,
queue: &str,
max_attempts_per_minute: i32,
max_in_flight: i32,
throttle_delay_ms: i32,
) -> Result<(), Error>
pub async fn upsert_policy( &self, queue: &str, max_attempts_per_minute: i32, max_in_flight: i32, throttle_delay_ms: i32, ) -> Result<(), Error>
Creates or replaces the execution policy for queue.
§Examples
use azums::PoliciesRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let policies = PoliciesRepo::new(pool);
let _ = policies;Trait Implementations§
Source§impl Clone for PoliciesRepo
impl Clone for PoliciesRepo
Source§fn clone(&self) -> PoliciesRepo
fn clone(&self) -> PoliciesRepo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PoliciesRepo
impl !UnwindSafe for PoliciesRepo
impl Freeze for PoliciesRepo
impl Send for PoliciesRepo
impl Sync for PoliciesRepo
impl Unpin for PoliciesRepo
impl UnsafeUnpin for PoliciesRepo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more