-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from JuliaComputing/tan/ci
improve timeout and server error handling
- Loading branch information
Showing
22 changed files
with
1,477 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
grpc-go | ||
server.pid | ||
runserver_* | ||
routeguide_* | ||
grpcerrors_* | ||
testservers |
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,84 @@ | ||
module GrpcerrorsClients | ||
using gRPCClient | ||
|
||
include("grpcerrors.jl") | ||
using .grpcerrors | ||
|
||
import Base: show | ||
|
||
# begin service: grpcerrors.GRPCErrors | ||
|
||
export GRPCErrorsBlockingClient, GRPCErrorsClient | ||
|
||
struct GRPCErrorsBlockingClient | ||
controller::gRPCController | ||
channel::gRPCChannel | ||
stub::GRPCErrorsBlockingStub | ||
|
||
function GRPCErrorsBlockingClient(api_base_url::String; kwargs...) | ||
controller = gRPCController(; kwargs...) | ||
channel = gRPCChannel(api_base_url) | ||
stub = GRPCErrorsBlockingStub(channel) | ||
new(controller, channel, stub) | ||
end | ||
end | ||
|
||
struct GRPCErrorsClient | ||
controller::gRPCController | ||
channel::gRPCChannel | ||
stub::GRPCErrorsStub | ||
|
||
function GRPCErrorsClient(api_base_url::String; kwargs...) | ||
controller = gRPCController(; kwargs...) | ||
channel = gRPCChannel(api_base_url) | ||
stub = GRPCErrorsStub(channel) | ||
new(controller, channel, stub) | ||
end | ||
end | ||
|
||
show(io::IO, client::GRPCErrorsBlockingClient) = print(io, "GRPCErrorsBlockingClient(", client.channel.baseurl, ")") | ||
show(io::IO, client::GRPCErrorsClient) = print(io, "GRPCErrorsClient(", client.channel.baseurl, ")") | ||
|
||
import .grpcerrors: SimpleRPC | ||
""" | ||
SimpleRPC | ||
- input: grpcerrors.Data | ||
- output: grpcerrors.Data | ||
""" | ||
SimpleRPC(client::GRPCErrorsBlockingClient, inp::grpcerrors.Data) = SimpleRPC(client.stub, client.controller, inp) | ||
SimpleRPC(client::GRPCErrorsClient, inp::grpcerrors.Data, done::Function) = SimpleRPC(client.stub, client.controller, inp, done) | ||
|
||
import .grpcerrors: StreamResponse | ||
""" | ||
StreamResponse | ||
- input: grpcerrors.Data | ||
- output: Channel{grpcerrors.Data} | ||
""" | ||
StreamResponse(client::GRPCErrorsBlockingClient, inp::grpcerrors.Data) = StreamResponse(client.stub, client.controller, inp) | ||
StreamResponse(client::GRPCErrorsClient, inp::grpcerrors.Data, done::Function) = StreamResponse(client.stub, client.controller, inp, done) | ||
|
||
import .grpcerrors: StreamRequest | ||
""" | ||
StreamRequest | ||
- input: Channel{grpcerrors.Data} | ||
- output: grpcerrors.Data | ||
""" | ||
StreamRequest(client::GRPCErrorsBlockingClient, inp::Channel{grpcerrors.Data}) = StreamRequest(client.stub, client.controller, inp) | ||
StreamRequest(client::GRPCErrorsClient, inp::Channel{grpcerrors.Data}, done::Function) = StreamRequest(client.stub, client.controller, inp, done) | ||
|
||
import .grpcerrors: StreamRequestResponse | ||
""" | ||
StreamRequestResponse | ||
- input: Channel{grpcerrors.Data} | ||
- output: Channel{grpcerrors.Data} | ||
""" | ||
StreamRequestResponse(client::GRPCErrorsBlockingClient, inp::Channel{grpcerrors.Data}) = StreamRequestResponse(client.stub, client.controller, inp) | ||
StreamRequestResponse(client::GRPCErrorsClient, inp::Channel{grpcerrors.Data}, done::Function) = StreamRequestResponse(client.stub, client.controller, inp, done) | ||
|
||
# end service: grpcerrors.GRPCErrors | ||
|
||
end # module GrpcerrorsClients |
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,4 @@ | ||
module grpcerrors | ||
const _ProtoBuf_Top_ = @static isdefined(parentmodule(@__MODULE__), :_ProtoBuf_Top_) ? (parentmodule(@__MODULE__))._ProtoBuf_Top_ : parentmodule(@__MODULE__) | ||
include("grpcerrors_pb.jl") | ||
end |
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,77 @@ | ||
# syntax: proto3 | ||
using ProtoBuf | ||
import ProtoBuf.meta | ||
|
||
mutable struct Data <: ProtoType | ||
__protobuf_jl_internal_meta::ProtoMeta | ||
__protobuf_jl_internal_values::Dict{Symbol,Any} | ||
__protobuf_jl_internal_defaultset::Set{Symbol} | ||
|
||
function Data(; kwargs...) | ||
obj = new(meta(Data), Dict{Symbol,Any}(), Set{Symbol}()) | ||
values = obj.__protobuf_jl_internal_values | ||
symdict = obj.__protobuf_jl_internal_meta.symdict | ||
for nv in kwargs | ||
fldname, fldval = nv | ||
fldtype = symdict[fldname].jtyp | ||
(fldname in keys(symdict)) || error(string(typeof(obj), " has no field with name ", fldname)) | ||
values[fldname] = isa(fldval, fldtype) ? fldval : convert(fldtype, fldval) | ||
end | ||
obj | ||
end | ||
end # mutable struct Data | ||
const __meta_Data = Ref{ProtoMeta}() | ||
function meta(::Type{Data}) | ||
ProtoBuf.metalock() do | ||
if !isassigned(__meta_Data) | ||
__meta_Data[] = target = ProtoMeta(Data) | ||
allflds = Pair{Symbol,Union{Type,String}}[:mode => Int32, :param => Int32] | ||
meta(target, Data, allflds, ProtoBuf.DEF_REQ, ProtoBuf.DEF_FNUM, ProtoBuf.DEF_VAL, ProtoBuf.DEF_PACK, ProtoBuf.DEF_WTYPES, ProtoBuf.DEF_ONEOFS, ProtoBuf.DEF_ONEOF_NAMES) | ||
end | ||
__meta_Data[] | ||
end | ||
end | ||
function Base.getproperty(obj::Data, name::Symbol) | ||
if name === :mode | ||
return (obj.__protobuf_jl_internal_values[name])::Int32 | ||
elseif name === :param | ||
return (obj.__protobuf_jl_internal_values[name])::Int32 | ||
else | ||
getfield(obj, name) | ||
end | ||
end | ||
|
||
# service methods for GRPCErrors | ||
const _GRPCErrors_methods = MethodDescriptor[ | ||
MethodDescriptor("SimpleRPC", 1, Data, Data), | ||
MethodDescriptor("StreamResponse", 2, Data, Channel{Data}), | ||
MethodDescriptor("StreamRequest", 3, Channel{Data}, Data), | ||
MethodDescriptor("StreamRequestResponse", 4, Channel{Data}, Channel{Data}) | ||
] # const _GRPCErrors_methods | ||
const _GRPCErrors_desc = ServiceDescriptor("grpcerrors.GRPCErrors", 1, _GRPCErrors_methods) | ||
|
||
GRPCErrors(impl::Module) = ProtoService(_GRPCErrors_desc, impl) | ||
|
||
mutable struct GRPCErrorsStub <: AbstractProtoServiceStub{false} | ||
impl::ProtoServiceStub | ||
GRPCErrorsStub(channel::ProtoRpcChannel) = new(ProtoServiceStub(_GRPCErrors_desc, channel)) | ||
end # mutable struct GRPCErrorsStub | ||
|
||
mutable struct GRPCErrorsBlockingStub <: AbstractProtoServiceStub{true} | ||
impl::ProtoServiceBlockingStub | ||
GRPCErrorsBlockingStub(channel::ProtoRpcChannel) = new(ProtoServiceBlockingStub(_GRPCErrors_desc, channel)) | ||
end # mutable struct GRPCErrorsBlockingStub | ||
|
||
SimpleRPC(stub::GRPCErrorsStub, controller::ProtoRpcController, inp::Data, done::Function) = call_method(stub.impl, _GRPCErrors_methods[1], controller, inp, done) | ||
SimpleRPC(stub::GRPCErrorsBlockingStub, controller::ProtoRpcController, inp::Data) = call_method(stub.impl, _GRPCErrors_methods[1], controller, inp) | ||
|
||
StreamResponse(stub::GRPCErrorsStub, controller::ProtoRpcController, inp::Data, done::Function) = call_method(stub.impl, _GRPCErrors_methods[2], controller, inp, done) | ||
StreamResponse(stub::GRPCErrorsBlockingStub, controller::ProtoRpcController, inp::Data) = call_method(stub.impl, _GRPCErrors_methods[2], controller, inp) | ||
|
||
StreamRequest(stub::GRPCErrorsStub, controller::ProtoRpcController, inp::Channel{Data}, done::Function) = call_method(stub.impl, _GRPCErrors_methods[3], controller, inp, done) | ||
StreamRequest(stub::GRPCErrorsBlockingStub, controller::ProtoRpcController, inp::Channel{Data}) = call_method(stub.impl, _GRPCErrors_methods[3], controller, inp) | ||
|
||
StreamRequestResponse(stub::GRPCErrorsStub, controller::ProtoRpcController, inp::Channel{Data}, done::Function) = call_method(stub.impl, _GRPCErrors_methods[4], controller, inp, done) | ||
StreamRequestResponse(stub::GRPCErrorsBlockingStub, controller::ProtoRpcController, inp::Channel{Data}) = call_method(stub.impl, _GRPCErrors_methods[4], controller, inp) | ||
|
||
export Data, GRPCErrors, GRPCErrorsStub, GRPCErrorsBlockingStub, SimpleRPC, StreamResponse, StreamRequest, StreamRequestResponse |
Oops, something went wrong.