Skip to content

Commit

Permalink
Merge pull request #157 from stealthrocket/creation-expiration-time
Browse files Browse the repository at this point in the history
Creation/expiration time
  • Loading branch information
chriso authored Apr 29, 2024
2 parents a47ae12 + 34e0f66 commit fb0214b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/dispatch/proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class Input:
"dispatch_id",
"parent_dispatch_id",
"root_dispatch_id",
"creation_time",
"expiration_time",
"_has_input",
"_input",
"_coroutine_state",
Expand All @@ -66,6 +68,12 @@ def __init__(self, req: function_pb.RunRequest):
self.dispatch_id = req.dispatch_id
self.parent_dispatch_id = req.parent_dispatch_id
self.root_dispatch_id = req.root_dispatch_id
self.creation_time = (
req.creation_time.ToDatetime() if req.creation_time else None
)
self.expiration_time = (
req.expiration_time.ToDatetime() if req.expiration_time else None
)

self._has_input = req.HasField("input")
if self._has_input:
Expand Down
15 changes: 8 additions & 7 deletions src/dispatch/sdk/v1/function_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/dispatch/sdk/v1/function_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ from typing import Union as _Union
from google.protobuf import any_pb2 as _any_pb2
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import timestamp_pb2 as _timestamp_pb2

from dispatch.sdk.v1 import exit_pb2 as _exit_pb2
from dispatch.sdk.v1 import poll_pb2 as _poll_pb2
Expand All @@ -21,19 +22,25 @@ class RunRequest(_message.Message):
"dispatch_id",
"parent_dispatch_id",
"root_dispatch_id",
"creation_time",
"expiration_time",
)
FUNCTION_FIELD_NUMBER: _ClassVar[int]
INPUT_FIELD_NUMBER: _ClassVar[int]
POLL_RESULT_FIELD_NUMBER: _ClassVar[int]
DISPATCH_ID_FIELD_NUMBER: _ClassVar[int]
PARENT_DISPATCH_ID_FIELD_NUMBER: _ClassVar[int]
ROOT_DISPATCH_ID_FIELD_NUMBER: _ClassVar[int]
CREATION_TIME_FIELD_NUMBER: _ClassVar[int]
EXPIRATION_TIME_FIELD_NUMBER: _ClassVar[int]
function: str
input: _any_pb2.Any
poll_result: _poll_pb2.PollResult
dispatch_id: str
parent_dispatch_id: str
root_dispatch_id: str
creation_time: _timestamp_pb2.Timestamp
expiration_time: _timestamp_pb2.Timestamp
def __init__(
self,
function: _Optional[str] = ...,
Expand All @@ -42,6 +49,8 @@ class RunRequest(_message.Message):
dispatch_id: _Optional[str] = ...,
parent_dispatch_id: _Optional[str] = ...,
root_dispatch_id: _Optional[str] = ...,
creation_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
expiration_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
) -> None: ...

class RunResponse(_message.Message):
Expand Down

0 comments on commit fb0214b

Please sign in to comment.