-
Couldn't load subscription status.
- Fork 24
feature: udsink gRPC #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1fd54e1
add initial grpc sink
cd3afa0
update docstring and example
433d247
remove Message type as we can use the Datum type now
60ed2cc
fix docstring
351a285
fix function->sink
11f3480
fix server sink fn
d0395a3
add tests
619d0e3
add back key
af63c4f
update code cov
f83ddea
add tests
6ce6275
add test
f8a7dcd
remove _tools.py
c87797a
update patch
a2533e6
Update examples/sink/simplesink/example.py
jy4096 8ef2420
Update pynumaflow/sink/_dtypes.py
jy4096 3988320
Update pynumaflow/sink/_dtypes.py
jy4096 e03bc7a
Update pynumaflow/sink/_dtypes.py
jy4096 df7e49b
Update pynumaflow/sink/_dtypes.py
jy4096 ea17601
Update pynumaflow/sink/server.py
jy4096 e2264f8
update comments -> pascal case
1bb561e
rename datum_list -> datums
510f796
rename response_list -> responses
92c55a0
reformat
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,15 @@ | ||
| from typing import List | ||
| from pynumaflow.sink import Datum, Responses, Response, UserDefinedSinkServicer | ||
|
|
||
| from pynumaflow.sink import Message, Responses, Response, HTTPSinkHandler | ||
|
|
||
|
|
||
| def udsink_handler(messages: List[Message], __) -> Responses: | ||
| def udsink_handler(datums: List[Datum], __) -> Responses: | ||
| responses = Responses() | ||
| for msg in messages: | ||
| print("Msg", msg) | ||
| for msg in datums: | ||
| print("User Defined Sink", msg) | ||
| responses.append(Response.as_success(msg.id)) | ||
| return responses | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| handler = HTTPSinkHandler(udsink_handler) | ||
| handler.start() | ||
| grpc_server = UserDefinedSinkServicer(udsink_handler) | ||
| grpc_server.start() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| from pynumaflow.sink.handler import HTTPSinkHandler | ||
| from pynumaflow.sink._dtypes import Message, Response, Responses | ||
| from pynumaflow.sink._dtypes import Response, Responses, Datum | ||
| from pynumaflow.sink.server import UserDefinedSinkServicer | ||
|
|
||
| __all__ = ["HTTPSinkHandler", "Message", "Response", "Responses"] | ||
| __all__ = ["Response", "Responses", "Datum", "UserDefinedSinkServicer"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| from google.protobuf import descriptor as _descriptor | ||
| from google.protobuf import message as _message | ||
| from google.protobuf import timestamp_pb2 as _timestamp_pb2 | ||
| from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 | ||
| from typing import ( | ||
| ClassVar as _ClassVar, | ||
| Mapping as _Mapping, | ||
| Optional as _Optional, | ||
| Union as _Union, | ||
| List, | ||
| ) | ||
|
|
||
| DESCRIPTOR: _descriptor.FileDescriptor | ||
|
|
||
| class ReadyResponse(_message.Message): | ||
| __slots__ = ["ready"] | ||
| READY_FIELD_NUMBER: _ClassVar[int] | ||
| ready: bool | ||
| def __init__(self, ready: _Optional[bool] = ...) -> None: ... | ||
|
|
||
| class EventTime(_message.Message): | ||
| __slots__ = ["event_time"] | ||
| EVENT_TIME_FIELD_NUMBER: _ClassVar[int] | ||
| event_time: _timestamp_pb2.Timestamp | ||
| def __init__(self, event_time: _Optional[_timestamp_pb2.Timestamp] = ...) -> None: ... | ||
|
|
||
| class Watermark(_message.Message): | ||
| __slots__ = ["watermark"] | ||
| WATERMARK_FIELD_NUMBER: _ClassVar[int] | ||
| watermark: _timestamp_pb2.Timestamp | ||
| def __init__(self, watermark: _Optional[_timestamp_pb2.Timestamp] = ...) -> None: ... | ||
|
|
||
| class Datum(_message.Message): | ||
| __slots__ = ["key", "value", "event_time", "watermark", "id"] | ||
| KEY_FIELD_NUMBER: _ClassVar[int] | ||
| VALUE_FIELD_NUMBER: _ClassVar[int] | ||
| ID_FIELD_NUMBER: _ClassVar[int] | ||
| EVENT_TIME_FIELD_NUMBER: _ClassVar[int] | ||
| WATERMARK_FIELD_NUMBER: _ClassVar[int] | ||
| key: str | ||
| value: bytes | ||
| id: str | ||
| event_time: _timestamp_pb2.Timestamp | ||
| watermark: _timestamp_pb2.Timestamp | ||
| def __init__( | ||
| self, | ||
| key: _Optional[str], | ||
| value: _Optional[bytes], | ||
| id: _Optional[str], | ||
| event_time: _Optional[_timestamp_pb2.Timestamp] = ..., | ||
| watermark: _Optional[_timestamp_pb2.Timestamp] = ..., | ||
| ) -> None: ... | ||
|
|
||
| class DatumList(_message.Message): | ||
| __slots__ = ["elements"] | ||
| ELEMENTS_FIELD_NUMBER: _ClassVar[int] | ||
| elements: List[Datum] | ||
| def __init__(self, elements: _Optional[List[Datum]]) -> None: ... | ||
|
|
||
| class Response(_message.Message): | ||
| __slots__ = ["id", "success", "err_msg"] | ||
| ID_FIELD_NUMBER: _ClassVar[int] | ||
| SUCCESS_FIELD_NUMBER: _ClassVar[int] | ||
| ERR_MSG_FIELD_NUMBER: _ClassVar[int] | ||
| id: str | ||
| success: bool | ||
| err_msg: str | ||
| def __init__( | ||
| self, | ||
| id: _Optional[str], | ||
| success: _Optional[bool], | ||
| err_msg: _Optional[str], | ||
| ) -> None: ... | ||
|
|
||
| class ResponseList(_message.Message): | ||
| __slots__ = ["responses"] | ||
| RESPONSES_FIELD_NUMBER: _ClassVar[int] | ||
| responses: List[Response] | ||
| def __init__(self, responses: _Optional[List[Response]]) -> None: ... |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.