mirror of
https://github.com/php-win-ext/grpc.git
synced 2026-03-24 09:02:15 +01:00
See https://github.com/grpc/grpc/issues/38210#issuecomment-2783948947 for context Now that Event Engine is enabled, we no longer need the channel polling thread, so we can remove it. Fork support (with event engine left enabled), is still broken on this PR as it is on master, but it will get cleaned up after https://github.com/grpc/grpc/pull/38980 (tested by manually merging and running fork tests) While we're here: - Regenerate greeter example protos - Remove `channel_state_test.rb` in favor of `connectivity_watch_interrupted_test.rb`. The former was skipped due to https://bugs.ruby-lang.org/issues/15499, the new test changes things so that we no longer hit that bug, but still exercise the no_gvl connectivity state watch machinery. - tweaks to fork tests (they are not running continuously but we should be able to re-enable them again after https://github.com/grpc/grpc/pull/38980 lands Closes #39409 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39409 from apolcyn:fix_bugs 3e3ae7d81fcbd13b1d0eed6b13c7c39fe1bd1030 PiperOrigin-RevId: 766790187
gRPC in 3 minutes (Ruby)
BACKGROUND
For this sample, we've already generated the server and client stubs from helloworld.proto
PREREQUISITES
-
Ruby 2.x This requires Ruby 2.x, as the gRPC API surface uses keyword args. If you don't have that installed locally, you can use RVM to use Ruby 2.x for testing without upgrading the version of Ruby on your whole system. RVM is also useful if you don't have the necessary privileges to update your system's Ruby.
$ # RVM installation as specified at https://rvm.io/rvm/install $ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 $ \curl -sSL https://get.rvm.io | bash -s stable --ruby=ruby-2 $ $ # follow the instructions to ensure that your're using the latest stable version of Ruby $ # and that the rvm command is installed -
N.B Make sure your run
source $HOME/.rvm/scripts/rvmas instructed to complete the set-up of RVM.
INSTALL
-
Use bundler to install the example package's dependencies
$ # from this directory $ gem install bundler # if you don't already have bundler available $ bundle install
Try it!
-
Run the server
$ # from this directory $ bundle exec ./greeter_server.rb & -
Run the client
$ # from this directory $ bundle exec ./greeter_client.rb
Tutorial
You can find a more detailed tutorial in gRPC Basics: Ruby