-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce handshake to client and gRPC server (#42)
Signed-off-by: Derek Wang <[email protected]>
- Loading branch information
Showing
16 changed files
with
395 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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,19 @@ | ||
// Package info is used for the gRPC server to provide the information such as protocol, sdk version, language, etc, to the client. | ||
// | ||
// The server information can be used by the client to determine: | ||
// - what is right protocol to use (UDS or TCP) | ||
// - what is the numaflow sdk version used by the server | ||
// - what is language used by the server | ||
// | ||
// The gRPC server (UDF, UDSink, etc) is supposed to have a shared file system with the client (numa container). | ||
// | ||
// Write() | ||
// The gPRC server must use this function to write the correct ServerInfo when it starts. | ||
// | ||
// Read() | ||
// The client is supposed to call the function to read the server information, before it starts to communicate with the gRPC server. | ||
// | ||
// WaitUntilReady() | ||
// This function checks if the server info file is ready to read. | ||
// The client (numa container) is supposed to call the function before it starts to Read() the server info file. | ||
package info |
This file contains 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,20 @@ | ||
package info | ||
|
||
type options struct { | ||
svrInfoFilePath string | ||
} | ||
|
||
func defaultOptions() *options { | ||
return &options{ | ||
svrInfoFilePath: ServerInfoFilePath, | ||
} | ||
} | ||
|
||
type Option func(*options) | ||
|
||
// WithServerInfoFilePath sets the server info file path | ||
func WithServerInfoFilePath(f string) Option { | ||
return func(o *options) { | ||
o.svrInfoFilePath = f | ||
} | ||
} |
Oops, something went wrong.