Skip to content

Commit

Permalink
Update howto-schedule-and-handle-triggered-jobs.md
Browse files Browse the repository at this point in the history
Signed-off-by: Yaron Schneider <[email protected]>
  • Loading branch information
yaron2 authored Oct 10, 2024
1 parent 8d0a1e5 commit 4141075
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,15 @@ In this example, at trigger time, which is `@every 1s` according to the `Schedul

At the trigger time, the `prodDBBackupHandler` function is called, executing the desired business logic for this job at trigger time. For example:

### Triggered Job Handling Assumptions

Note: The following information applies to **all programming languages**, not just the Go examples provided in this
documentation. As of Dapr release v1.14, the Jobs API is only supported in the Go SDK, but support for additional SDKs
and languages will be added in future releases.

#### HTTP

When you create a job using Dapr's Jobs API, Dapr will automatically assume there is an endpoint available at
`/job/<job-name>`. For instance, if you schedule a job named `test`, Dapr expects your application to listen for job
events at `/job/test`. Ensure your application has a handler set up for this endpoint to process the job when it is
triggered. For example:

*Note: The following example is in Go but applies to any programming language.*

```go

func main() {
Expand All @@ -130,6 +126,8 @@ func handleJob(w http.ResponseWriter, r *http.Request) {
When a job reaches its scheduled trigger time, the triggered job is sent back to the application via the following
callback function:

*Note: The following example is in Go but applies to any programming language with gRPC support.*

```go
import rtv1 "github.com/dapr/dapr/pkg/proto/runtime/v1"
...
Expand Down Expand Up @@ -215,4 +213,4 @@ dapr run --app-id=distributed-scheduler \
## Next steps

- [Learn more about the Scheduler control plane service]({{< ref "concepts/dapr-services/scheduler.md" >}})
- [Jobs API reference]({{< ref jobs_api.md >}})
- [Jobs API reference]({{< ref jobs_api.md >}})

0 comments on commit 4141075

Please sign in to comment.