{"id":22741749,"url":"https://github.com/crystallabs/ro4r","last_synced_at":"2025-09-06T01:33:16.624Z","repository":{"id":1058322,"uuid":"891457","full_name":"crystallabs/RO4R","owner":"crystallabs","description":"Remote Objects for Ruby -- Production-quality transparent RPC library for Ruby","archived":false,"fork":false,"pushed_at":"2019-11-10T15:27:26.000Z","size":47,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T04:14:08.512Z","etag":null,"topics":["rpc-client","rpc-library","rpc-server","ruby","ruby-mri","transparent"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crystallabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-09-06T14:30:35.000Z","updated_at":"2020-08-29T16:33:58.000Z","dependencies_parsed_at":"2022-08-16T11:55:20.333Z","dependency_job_id":null,"html_url":"https://github.com/crystallabs/RO4R","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/crystallabs/RO4R","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystallabs%2FRO4R","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystallabs%2FRO4R/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystallabs%2FRO4R/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystallabs%2FRO4R/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crystallabs","download_url":"https://codeload.github.com/crystallabs/RO4R/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystallabs%2FRO4R/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273846966,"owners_count":25178628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["rpc-client","rpc-library","rpc-server","ruby","ruby-mri","transparent"],"created_at":"2024-12-11T00:16:46.626Z","updated_at":"2025-09-06T01:33:16.601Z","avatar_url":"https://github.com/crystallabs.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RO4R - Remote Objects for Ruby 2.4+\n\nGit export of RO4R, a Ruby RPC library that has been in production use since 2007.\n\n## Supported Ruby versions\n\nSupports all Ruby versions from 2.4 above, in all combinations of client and server versions.\n\nFor support on older versions, please see below under \"Other Ruby versions\".\n\n## How to see it work\n\n1. Check out the files:\n\n```\n  git clone git://github.com/crystallabs/RO4R.git\n```\n\n1. In one terminal, start an example server. It will listen on port 4044, export one Ruby Hash variable, and provide the main loop:\n\n```\n  cd RO4R\n  ruby -I. examples/srv.rb\n```\n\n1. In another terminal, start an example client. It will attach to the server and shared Hash, iterate a counter 10_000 times, and then print the benchmark statistics and the final contents of the Hash:\n\n```\n  cd RO4R\n  ruby -I. examples/cli.rb\n```\n\nNOTE: when the client program does its job and disconnects, on the server side you will see the following message which you can safely ignore:\n\n```\n#\u003cNoMethodError: undefined method `length' for nil:NilClass\u003e)\n```\n\n### Benchmarks explanation\n\nWhen you run the above, it will print statistics such as:\n\n```\n0.390000   0.390000   0.780000 (  1.451144)\n{:counter=\u003e9999, 1=\u003eA, 2=\u003e#\u003cA:0xb7741e38\u003e}\n```\n\nThe first line is the benchmark output, showing user, system, total and real times. (That's benchmark for the 10,000 iterations that the example client does).\n\nThe second line are the contents of the shared Hash object. In it you see the :counter that was created on the client side, and two keys that were initialized by the example server.\n\n### Testing\n\nTo test RO4R, you can create two processes (client and server), and then display and modify variables and invoke remote functions.\n\n1. To conveniently test modifying data, run the basic benchmark under IRB, then modify some hash keys on the example shared object `$r`:\n\n```\n$ cd RO4R\n$ irb -I. -r examples/cli.rb\n\n# ... statistics will be printed ...\n\n\u003e $r[:counter]\n9999\n\u003e $r[:test_value]= 717\n#-\u003e 717\n```\n\n1. To run defined functions, simply call them:\n\nOn the server side, in the example we have initialized an example method 'm' that returns value of 1; you can run it:\n\n```\n\u003e $r[2].m\n#-\u003e 1\n```\n\n1. Multiple clients:\n\nYou can also open a new/third terminal in which you can query all the changes:\n\n```\n$ cd RO4R\n$ irb -I. -r examples/cli.rb\n\n\u003e $r\n{:counter=\u003e9999, 1=\u003eA, 2=\u003e#\u003cA:0xb7745e34\u003e, :test_value=\u003e717}\n```\n\n## Benchmarks\n\nBenchmarks for 10,000 RPC invocations:\n\n```\nDate        Server   Client     Stats\nJun 2018:   2.6.0p2   2.6.0p2   0.192000   0.100000   0.292000 (  0.517264)\nOct 2015:   2.2.3     2.2.3     0.196000   0.076000   0.272000 (  0.481286)\n\nJun 2018 setup was: i7-4790K CPU @ 4.00GHz on Linux 3.16.0-4-amd64\nOct 2015 setup was: i7-4790K CPU @ 4.00GHz on Linux 4.2.0-040200-lowlatency\n\nOlder Benchmarks from 2008:\n\n            Server   Client     Stats\n            1.9.2     1.9.2     0.390000   0.390000   0.780000 (  1.451144)\n            1.9.2     1.8.7     1.000000   0.280000   1.280000 (  2.009202)\n            1.8.7     1.9.2     0.520000   0.300000   0.820000 (  1.914454)\n            1.8.7     1.8.7     0.960000   0.260000   1.220000 (  2.472942)\n```\n\n## Programming notes\n\n### Shared classes\n\nGenerally, you will share instances of classes that are known to both the server and the clients.\n\nBut it is also possible to share objects that clients know nothing about.\n\nIncluded in the distribution is rmarshal/, a modification of\nRuby marshaller that you need to compile and 'require' into\nyour Ruby app on the server side (the one that exports the object),\nwithout any other changes.\n\nWith that, the clients will transparently be able to use the remote\nobject even though they don't know its Class.\n\nNOTE: rmarshal.c is currently out of date, and the version included works with Ruby 1.8.\n\n### Method return values\n\nWhen writing methods, you usually don't care about unused return\nvalues because Ruby simply discards them.\n\nHowever, on methods that are invoked remotely, RO4R will pass the return\nvalue back to the client,\nso pay attention to exit a method with an explicit 'nil' if its return\nvalue is not needed. This is cleaner and can also save you from errors\nif the (unnecessary) return value would be a weird object that Ruby\nmarshaller can't serialize and pass back to the client.\n\n### Code stability\n\nRO4R has been in production use with Ruby 1.8, 1.9, and later since 2007.\n\n## Other Ruby versions\n\nFor use with lower versions (Ruby 1.8 to Ruby 2.3) , please either use RO4R release 1.0.0\nor edit RO4R.rb to replace \"safe= 1\" with \"safe= 3\" and uncomment the line saying\n\"Bignum, Fixnum\".\n\nThe C marshaller (rmarshall) is operational only for Ruby 1.8 versions.\n\n## TODO\n\n* Add rmarshall for newer Ruby versions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystallabs%2Fro4r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrystallabs%2Fro4r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystallabs%2Fro4r/lists"}