Skip to content

Commit

Permalink
rust: Add Svix::background_task (#1341)
Browse files Browse the repository at this point in the history
## Motivation

We previously had the `BackgroundTask` object as a proxy object for the
two background task routes, but no way to construct and thus use it.

## Solution

Add a method to `Svix` like we have for all the other proxy objects.

Closes #1340.
  • Loading branch information
svix-jplatte authored Jun 19, 2024
2 parents 598593e + ade55ed commit 40184eb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rust/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ impl Svix {
Application::new(&self.cfg)
}

pub fn background_task(&self) -> BackgroundTask<'_> {
BackgroundTask::new(&self.cfg)
}

pub fn endpoint(&self) -> Endpoint<'_> {
Endpoint::new(&self.cfg)
}
Expand Down Expand Up @@ -1222,6 +1226,10 @@ pub struct BackgroundTask<'a> {
}

impl<'a> BackgroundTask<'a> {
fn new(cfg: &'a Configuration) -> Self {
Self { cfg }
}

pub async fn list(
&self,
options: Option<BackgroundTaskListOptions>,
Expand Down

0 comments on commit 40184eb

Please sign in to comment.