@@ -36,6 +36,7 @@ pub struct EchoInputs {
3636 // pub bounding_box_input: Option<BoundingBoxInput>,
3737 // pub images_input: Option<Vec<String>>,
3838 // pub feature_collection_input: Option<String>,
39+ pub pause : Option < u64 > ,
3940}
4041
4142#[ derive( Deserialize , Serialize , Debug , JsonSchema ) ]
@@ -174,20 +175,50 @@ impl Processor for Echo {
174175 . title( "Execution endpoint" ) ,
175176 ] ,
176177 } ,
177- inputs : HashMap :: from ( [ (
178- "stringInput" . to_string ( ) ,
179- InputDescription {
180- description_type : DescriptionType {
181- title : Some ( "String Literal Input Example" . to_string ( ) ) ,
182- description : Some (
183- "This is an example of a STRING literal input." . to_string ( ) ,
184- ) ,
178+ inputs : HashMap :: from ( [
179+ (
180+ "stringInput" . to_string ( ) ,
181+ InputDescription {
182+ description_type : DescriptionType {
183+ title : Some ( "String Literal Input Example" . to_string ( ) ) ,
184+ description : Some (
185+ "This is an example of a STRING literal input." . to_string ( ) ,
186+ ) ,
187+ ..Default :: default ( )
188+ } ,
189+ schema : generator. root_schema_for :: < StringInput > ( ) . to_value ( ) ,
185190 ..Default :: default ( )
186191 } ,
187- schema : generator. root_schema_for :: < StringInput > ( ) . to_value ( ) ,
188- ..Default :: default ( )
189- } ,
190- ) ] ) ,
192+ ) ,
193+ (
194+ "doubleInput" . to_string ( ) ,
195+ InputDescription {
196+ description_type : DescriptionType {
197+ title : Some ( "Double Literal Input Example" . to_string ( ) ) ,
198+ description : Some (
199+ "This is an example of a DOUBLE literal input." . to_string ( ) ,
200+ ) ,
201+ ..Default :: default ( )
202+ } ,
203+ schema : generator. root_schema_for :: < f64 > ( ) . to_value ( ) ,
204+ ..Default :: default ( )
205+ } ,
206+ ) ,
207+ (
208+ "pause" . to_string ( ) ,
209+ InputDescription {
210+ description_type : DescriptionType {
211+ title : Some ( "Pause Duration" . to_string ( ) ) ,
212+ description : Some (
213+ "Optional pause duration in seconds before responding." . to_string ( ) ,
214+ ) ,
215+ ..Default :: default ( )
216+ } ,
217+ schema : generator. root_schema_for :: < u64 > ( ) . to_value ( ) ,
218+ ..Default :: default ( )
219+ } ,
220+ ) ,
221+ ] ) ,
191222 outputs : HashMap :: from ( [ (
192223 "stringOutput" . to_string ( ) ,
193224 OutputDescription {
@@ -202,6 +233,10 @@ impl Processor for Echo {
202233 let value = serde_json:: to_value ( execute. inputs ) ?;
203234 let inputs: EchoInputs = serde_json:: from_value ( value) ?;
204235
236+ if let Some ( pause_duration) = inputs. pause {
237+ tokio:: time:: sleep ( std:: time:: Duration :: from_secs ( pause_duration) ) . await ;
238+ }
239+
205240 let output_values = EchoOutputs {
206241 string_output : inputs. string_input ,
207242 double_output : inputs. double_input ,
0 commit comments