开发者

How to share datas between Ruby and c?

开发者 https://www.devze.com 2023-02-05 09:55 出处:网络
There is a Ruby process and has a string var name开发者_StackOverflowd \"switch\", and the \"switch\" will be updated by user.There are also 2 C daemon process, which need to access the \"switch\" in

There is a Ruby process and has a string var name开发者_StackOverflowd "switch", and the "switch" will be updated by user. There are also 2 C daemon process, which need to access the "switch" in a loop and decide the logic in runtime, how to deal with this case ? thanks!


A socket (or a common file) can be used as a pipe between them.


Given your description, it sounds like you need a message queue. Something like RabbitMQ should work. See http://www.rabbitmq.com/getstarted.html for details.

0

精彩评论

暂无评论...
验证码 换一张
取 消