@@ -33,13 +33,15 @@ class View(MethodView):
33
33
These functions will allow for automated documentation generation.
34
34
"""
35
35
36
- endpoint = None
37
- semtype : str = None
36
+ endpoint = None # Store the View endpoint for use in specs
38
37
38
+ # Basic view spec metadata
39
39
tags : list = [] # Custom tags the user can add
40
- _cls_tags = set () # Class tags that shouldn't be removed
41
40
title : None
42
41
42
+ # Internal
43
+ _cls_tags = set () # Class tags that shouldn't be removed
44
+
43
45
def __init__ (self , * args , ** kwargs ):
44
46
MethodView .__init__ (self , * args , ** kwargs )
45
47
@@ -144,6 +146,9 @@ class ActionView(View):
144
146
safe : bool = False # Does the action complete WITHOUT changing the Thing state
145
147
idempotent : bool = False # Can the action be performed idempotently
146
148
149
+ # Action handling
150
+ wait_for : int = 1 # Time in seconds to wait before returning the action as pending/running
151
+
147
152
# Internal
148
153
_cls_tags = {"actions" }
149
154
_deque = Deque () # Action queue
@@ -253,7 +258,7 @@ def dispatch_request(self, *args, **kwargs):
253
258
254
259
# Wait up to 2 second for the action to complete or error
255
260
try :
256
- task .get (block = True , timeout = 1 )
261
+ task .get (block = True , timeout = self . wait_for )
257
262
except Timeout :
258
263
pass
259
264
@@ -268,13 +273,15 @@ def dispatch_request(self, *args, **kwargs):
268
273
269
274
270
275
class PropertyView (View ):
276
+ # Data formatting
271
277
schema : Schema = None # Schema for input AND output
272
278
semtype : str = None # Semantic type string
273
279
274
280
# Spec overrides
275
281
content_type = "application/json" # Input and output contentType
276
282
responses = {} # Custom responses for all interactions
277
283
284
+ # Internal
278
285
_cls_tags = {"properties" }
279
286
280
287
@classmethod
0 commit comments