1818class RequestContext (object ):
1919
2020 def __init__ (self , app_name , route , call_id ,
21- fntype , config = None , headers = None , arguments = None ):
21+ fntype , execution_type = None , deadline = None ,
22+ config = None , headers = None , arguments = None ):
2223 """
2324 Request context here to be a placeholder
2425 for request-specific attributes
@@ -30,6 +31,8 @@ def __init__(self, app_name, route, call_id,
3031 self .__headers = headers if headers else {}
3132 self .__arguments = {} if not arguments else arguments
3233 self .__type = fntype
34+ self .__exec_type = execution_type
35+ self .__deadline = deadline
3336
3437 def AppName (self ):
3538 return self .__app_name
@@ -52,11 +55,18 @@ def Arguments(self):
5255 def Type (self ):
5356 return self .__type
5457
58+ def Deadline (self ):
59+ return self .__deadline
60+
61+ def ExecutionType (self ):
62+ return self .__exec_type
63+
5564
5665class HTTPContext (RequestContext ):
5766
5867 def __init__ (self , app_name , route ,
5968 call_id , fntype = "http" ,
69+ deadline = None , execution_type = None ,
6070 config = None , headers = None ,
6171 method = None , url = None ,
6272 query_parameters = None ,
@@ -70,16 +80,21 @@ def __init__(self, app_name, route,
7080 self .DispatchError = errors .HTTPDispatchException
7181 super (HTTPContext , self ).__init__ (
7282 app_name , route , call_id , fntype ,
83+ execution_type = execution_type , deadline = deadline ,
7384 config = config , headers = headers , arguments = arguments )
7485
7586
7687class JSONContext (RequestContext ):
7788
7889 def __init__ (self , app_name , route , call_id ,
79- fntype = "json" , config = None , headers = None ):
90+ fntype = "json" , deadline = None ,
91+ execution_type = None , config = None ,
92+ headers = None ):
8093 self .DispatchError = errors .JSONDispatchException
8194 super (JSONContext , self ).__init__ (
82- app_name , route , call_id , fntype , config = config , headers = headers )
95+ app_name , route , call_id , fntype ,
96+ execution_type = execution_type ,
97+ deadline = deadline , config = config , headers = headers )
8398
8499
85100def fromType (fntype , * args , ** kwargs ):
0 commit comments