-
Notifications
You must be signed in to change notification settings - Fork 0
GRPC Client for Chalk Typescript Client #64
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
Conversation
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
src/_http.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got sundered into multiple files - _services/_http.ts
and _services/_credentials.ts
contain the major classes this contained, and several types got moved to _interface/_index.ts
@@ -132,81 +139,6 @@ export type ChalkOnlineQueryResponseStatusKind = | |||
| "partial_success" | |||
| "error"; | |||
|
|||
export type ChalkErrorCode = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of the types removed here got moved into subfiles - this file was just getting impossible to navigate
import { parseOnlineQueryResponse } from "./_response"; | ||
|
||
export interface ChalkClientOpts { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got moved to _interface/_options.ts
@@ -0,0 +1,429 @@ | |||
import { ChalkError, isChalkError } from "../_errors"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file just a fraction of the _http.ts
original file.
this.credentials = null; | ||
} | ||
|
||
async getEngineUrlFromCredentials( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while most of this file is just moving the file, this function is new.
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
src/_services/_grpc.ts
Outdated
this.queryClient = this.queryClient = new QueryServiceClient( | ||
stripProtocol(endpoint), | ||
ChannelCredentials.createInsecure(), | ||
{ "grpc.enable_retries": maxNetworkRetries } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using the maxNetworkRetries correctly :)
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
Signed-off-by: Kelvin Lu <kelvin@chalk.ai>
This introduces a GPRC Client for the Chalk TS Client. This includes several major refactors of our code:
_interface
module, then sunders it into a directory with multiple subfilesChalkClient
so that there is aChalkHTTPClient
that contains more functions (the grpc client only supports the criticalOnlineQuery
,OnlineQueryBulk
, andOnlineQueryMulti
function)