pub struct SqsQueue {
pub region: Option<String>,
pub prefix: String,
pub suffix: String,
pub queue: String,
pub endpoint: Option<String>,
pub credentials: Option<AwsCredentials>,
pub overflow: Option<SqsOverflow>,
}Expand description
A connection that keeps jobs in Amazon SQS queues, with the sqs driver. Needs the sqs
feature.
Each queue name is an SQS queue. The queue’s URL is prefix, a slash, the name, and then
suffix, such as https://sqs.us-east-1.amazonaws.com/123456789012/emails-production. Without
a prefix, the connection looks up the URL by the queue’s name. A name that’s already a URL is
used as it is.
use laravel::config::queue::SqsQueue;
let queue = SqsQueue::new()
.region("eu-west-1")
.prefix("https://sqs.eu-west-1.amazonaws.com/123456789012")
.suffix("-production")
.queue("emails");A job’s attempt number is SQS’s approximate receive count, so a job can occasionally run once
more or once less than its allowed tries. A release or backoff ends at most 12 hours after the
worker took the job. The queue:clear command purges the queue, which SQS allows once a minute
per queue.
Fields§
§region: Option<String>The AWS region, or None for the region that the AWS SDK finds, such as from
AWS_REGION.
prefix: StringThe start of every queue’s URL, up to the queue’s name, or empty to look up URLs by name.
suffix: StringThe text added to the end of every queue’s name, such as an environment’s name.
queue: StringThe queue that jobs join when they don’t name one.
endpoint: Option<String>Another SQS endpoint, such as a local emulator’s http://localhost:4566.
credentials: Option<AwsCredentials>An access key, or None for the credentials that the AWS SDK finds, such as an instance’s
role.
overflow: Option<SqsOverflow>Where payloads too large for an SQS message are kept, or None to make dispatching them
fail.
Implementations§
Source§impl SqsQueue
impl SqsQueue
Sourcepub fn new() -> SqsQueue
pub fn new() -> SqsQueue
Returns a connection that uses the AWS SDK’s region and credentials, looks up queue URLs by
name, and uses the default queue.
Sourcepub fn from_env(env: &Env) -> SqsQueue
pub fn from_env(env: &Env) -> SqsQueue
Returns a connection that reads these variables when they’re set:
| Variable | Setting |
|---|---|
AWS_DEFAULT_REGION | region |
SQS_PREFIX | prefix |
SQS_SUFFIX | suffix |
SQS_QUEUE | queue |
AWS_ENDPOINT_URL_SQS | endpoint |
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN | credentials, when both the key and the secret are set |
SQS_OVERFLOW_ENABLED, SQS_OVERFLOW_STORE | overflow, in the named cache store or the default store, when enabled |
Sourcepub fn prefix(self, prefix: impl Into<String>) -> SqsQueue
pub fn prefix(self, prefix: impl Into<String>) -> SqsQueue
Sets the start of every queue’s URL, such as
https://sqs.us-east-1.amazonaws.com/123456789012.
Sourcepub fn suffix(self, suffix: impl Into<String>) -> SqsQueue
pub fn suffix(self, suffix: impl Into<String>) -> SqsQueue
Sets the text added to the end of every queue’s name.
Sourcepub fn queue(self, queue: impl Into<String>) -> SqsQueue
pub fn queue(self, queue: impl Into<String>) -> SqsQueue
Sets the queue that jobs join when they don’t name one.
Sourcepub fn endpoint(self, endpoint: impl Into<String>) -> SqsQueue
pub fn endpoint(self, endpoint: impl Into<String>) -> SqsQueue
Sends requests to another endpoint, such as a local emulator.
Sourcepub fn overflow(self, overflow: SqsOverflow) -> SqsQueue
pub fn overflow(self, overflow: SqsOverflow) -> SqsQueue
Keeps payloads that are too large for an SQS message in a cache store.
Trait Implementations§
impl Eq for SqsQueue
Source§impl From<SqsQueue> for ConnectionConfig
impl From<SqsQueue> for ConnectionConfig
Source§fn from(queue: SqsQueue) -> ConnectionConfig
fn from(queue: SqsQueue) -> ConnectionConfig
impl StructuralPartialEq for SqsQueue
Auto Trait Implementations§
impl Forget for SqsQueue
impl Freeze for SqsQueue
impl Move for SqsQueue
impl RefUnwindSafe for SqsQueue
impl Send for SqsQueuewhere
RawVecInner: Send,
impl Sync for SqsQueuewhere
RawVecInner: Sync,
impl Unpin for SqsQueue
impl UnsafeUnpin for SqsQueue
impl UnwindSafe for SqsQueuewhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<K> ForeignKey<K> for K
impl<K> ForeignKey<K> for K
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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