# Schedule Sidekiq Jobs Out Into The Future

The most common way to schedule a [Sidekiq](https://github.com/mperham/sidekiq) job is with the `perform_async` method. That will queue up your job so that it is worked as soon as possible. That may not also be desired. Sometimes you want a bit more say in when jobs are run.

The `perform_in` and `perform_at` methods can help with scheduling jobs out into the future.

With `perform_in` we can say how much time from now would be the soonest that we'd like the job performed.

```ruby
MyWorker.perform_in(10.minutes, arg1, arg2)
```

We can do the same thing with `perform_at`.

```ruby
MyWorker.perform_at(10.minutes.from_now, arg1, arg2)
```

Or we can schedule something out for a specific point in time in the future.

```ruby
MyWorker.perform_at(Date.today.end_of_week, arg1, arg2)
```

[source](https://github.com/mperham/sidekiq/wiki/Scheduled-Jobs)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ploegert.gitbook.io/til/programmy/rails/schedule-sidekiq-jobs-out-into-the-future.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
