README.md in grpc-orin3-provider-0.1.0 vs README.md in grpc-orin3-provider-1.0.0
- old
+ new
@@ -33,36 +33,33 @@
Connect to the ORiN3 provider by specifying the host and port.
```ruby
# Shorten namespaces for readability
module ORiN3
- include Message::ORiN3::Common::V1::AutoGenerated
- include Message::ORiN3::Provider::V1::AutoGenerated::RootObject
+ include Grpc::Client::ORiN3
+ include Grpc::Client::ORiN3::Provider
end
def main
- # Create a gRPC client stub
- stub = ORiN3::RootObjectService::Stub.new('localhost:50051', :this_channel_is_insecure)
+ channel = GRPC::Core::Channel.new("localhost:7103", nil, :this_channel_is_insecure)
+ remote_engine = ORiN3::RemoteEngine.new(channel)
+ id = "B0EFA63C-6610-4167-9DA6-9DDC11D145B2"
+ version = "[1.0.0,2.0.0)"
+ result = remote_engine.wakeup_provider(id, version, "0.0.0.0", 0)
+ puts "* wakeup test provider done. [uri=#{result.provider_information.endpoints[0].uri}]"
- # Prepare the request
- request = ORiN3::GetRootObjectIdRequest.new(common: ORiN3::CommonRequest.new)
+ uri = URI.parse(result.provider_information.endpoints[0].uri)
+ provider_channerl = GRPC::Core::Channel.new("#{uri.host}:#{uri.port}", nil, :this_channel_is_insecure)
+ root = ORiN3::ORiN3RootObject.attach(provider_channerl)
- # Call the RPC method
- response = stub.get_root_object_id(request)
- puts "Response: #{response.rootObjectId}"
- rescue GRPC::BadStatus => e
+ puts "Root.name: #{root.name}"
+ puts "Root.type_name: #{root.type_name}"
+ puts "Root.option: #{root.option}"
+ puts "Root.created_datetime: #{root.created_datetime.getlocal}"
+ puts "Root.orin3_object_type: #{root.orin3_object_type}"
+ puts "Root.id: #{root.id}"
+ rescue ORiN3::MessageClientError => e
abort "ERROR: #{e.message}"
- end
- ```
-
-2. **Error Handling**
- Proper error handling is included to manage any gRPC request failures.
-
- ```ruby
- begin
- response = stub.get_root_object_id(request)
- rescue GRPC::BadStatus => e
- puts "ERROR: #{e.common.detail}"
end
```
## About ORiN3
\ No newline at end of file