{"id":18268503,"url":"https://github.com/coreyjs/grpc-cache-example","last_synced_at":"2026-04-14T06:33:46.304Z","repository":{"id":45108765,"uuid":"281817941","full_name":"coreyjs/grpc-cache-example","owner":"coreyjs","description":"A ruby gRPC server that can store and retrieve files from memcache.  A Go client to interact with the server","archived":false,"fork":false,"pushed_at":"2022-11-22T00:01:29.000Z","size":51252,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-25T15:54:51.953Z","etag":null,"topics":["example-project","go","golang","grpc","grpc-server","learn","learning","memcache","ruby","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coreyjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-23T01:13:14.000Z","updated_at":"2021-01-02T02:34:38.000Z","dependencies_parsed_at":"2023-01-23T13:46:09.422Z","dependency_job_id":null,"html_url":"https://github.com/coreyjs/grpc-cache-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coreyjs/grpc-cache-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreyjs%2Fgrpc-cache-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreyjs%2Fgrpc-cache-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreyjs%2Fgrpc-cache-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreyjs%2Fgrpc-cache-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coreyjs","download_url":"https://codeload.github.com/coreyjs/grpc-cache-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreyjs%2Fgrpc-cache-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31785677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example-project","go","golang","grpc","grpc-server","learn","learning","memcache","ruby","tutorial"],"created_at":"2024-11-05T11:31:53.390Z","updated_at":"2026-04-14T06:33:46.288Z","avatar_url":"https://github.com/coreyjs.png","language":"Ruby","readme":"### This is an example project of connecting two distinct applications over gRPC.  \n\n\nThe gRPC server is written in ruby, and can be ran from the main directory, `ruby ./server.rb`.  This starts a gRPC server on port `50051`.\n\n```ruby\nclass CacheHubServer\n  class \u003c\u003c self\n    def start\n      start_grpc_server\n    end\n\n    private\n    def start_grpc_server\n      puts 'cache hub server up'\n      @server = GRPC::RpcServer.new\n      @server.add_http2_port('0.0.0.0:50052', :this_port_is_insecure)\n      @server.handle(CacheHubService)\n      @server.run_till_terminated\n    end\n  end\nend\n```\n---\n\nThere are currently only 2 methods defined in the `cache.proto` file:\n\n### StatusRequest\n- Used for basic health check on the server\n\n### Upload\n- Used as the main file transfer stream method\n\n```bash\nservice CacheHub {\n  rpc GetStatus(StatusRequest) returns (StatusResponse) {}\n  rpc Upload(stream Chunk) returns (UploadStatus) {}\n}\n```\n---\n### Client\nThe gRPC client in written in Go, and can be found in `/golang_client/`.  You can interact with the client from the command line:\n\n```\n\u003e go run client.go -h\n  -a string\n        action to preform.  status, get, store\n  -f string\n        file name\nexit status 2\n```\n\n### To store a file in memcache:\n\n`\u003e go run client.go -a=store -f=/path/to/file/myfile.pdf`\n\n\n### To get a file from the cache:\n\n`go run client.go -a=get -f=myfile.pdf`\n\n`File Location: /tmp/myfile.pdf -- md5: 61e4b830ec5baea0fa9ff430e8ddcfa7% `\n \nNote: this returns a file path location from the local system, for learning purposes only.\n\n\n---\n\n### The Ruby FileHandler and CacheBroker classes\n\nTODO:  Documentation\n\n\n\n\n---\n### Misc Notes:\n\nTo generate go client files:\n\n`protoc -I ../protos ../protos/cache.proto --go_out=plugins=grpc:cache`\n\n\nTo generate ruby server files:\n\n`grpc_tools_ruby_protoc -I protos --ruby_out=lib --grpc_out=lib protos/cache.proto`\n\n\nTo start ruby gRPC server:\n\n`ruby ./server.rb`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoreyjs%2Fgrpc-cache-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoreyjs%2Fgrpc-cache-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoreyjs%2Fgrpc-cache-example/lists"}