You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add specific logic for what assumptions are made for triggered jobs for http, grpc, sdks
Signed-off-by: Cassandra Coyle <[email protected]>
* rm space
Signed-off-by: Cassandra Coyle <[email protected]>
* add a note about this applying to all programming languages to avoid confusion
Signed-off-by: Cassandra Coyle <[email protected]>
* Update howto-schedule-and-handle-triggered-jobs.md
Signed-off-by: Yaron Schneider <[email protected]>
---------
Signed-off-by: Cassandra Coyle <[email protected]>
Signed-off-by: Yaron Schneider <[email protected]>
Co-authored-by: Yaron Schneider <[email protected]>
Copy file name to clipboardExpand all lines: daprdocs/content/en/developing-applications/building-blocks/jobs/howto-schedule-and-handle-triggered-jobs.md
+70-1Lines changed: 70 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,75 @@ In this example, at trigger time, which is `@every 1s` according to the `Schedul
94
94
95
95
At the trigger time, the `prodDBBackupHandler` function is called, executing the desired business logic for this job at trigger time. For example:
96
96
97
+
#### HTTP
98
+
99
+
When you create a job using Dapr's Jobs API, Dapr will automatically assume there is an endpoint available at
100
+
`/job/<job-name>`. For instance, if you schedule a job named `test`, Dapr expects your application to listen for job
101
+
events at `/job/test`. Ensure your application has a handler set up for this endpoint to process the job when it is
102
+
triggered. For example:
103
+
104
+
*Note: The following example is in Go but applies to any programming language.*
105
+
106
+
```go
107
+
108
+
funcmain() {
109
+
...
110
+
http.HandleFunc("/job/", handleJob)
111
+
http.HandleFunc("/job/<job-name>", specificJob)
112
+
...
113
+
}
114
+
115
+
funcspecificJob(whttp.ResponseWriter, r *http.Request) {
116
+
// Handle specific triggered job
117
+
}
118
+
119
+
funchandleJob(whttp.ResponseWriter, r *http.Request) {
120
+
// Handle the triggered jobs
121
+
}
122
+
```
123
+
124
+
#### gRPC
125
+
126
+
When a job reaches its scheduled trigger time, the triggered job is sent back to the application via the following
127
+
callback function:
128
+
129
+
*Note: The following example is in Go but applies to any programming language with gRPC support.*
0 commit comments