【文件属性】:
文件名称:ruby-sdnotify:systemd的sd_notify(3)的纯Ruby实现
文件大小:6KB
文件格式:ZIP
更新时间:2021-05-08 13:41:01
ruby systemd watchdog sdnotify sd-notify
Ruby-sdnotify
的纯Ruby实现,可用于将Ruby程序的状态更改传达给 。
有关更多信息,请参考。
入门
安装ruby-sdnotify:
$ gem install sd_notify
如果您使用的是Bundler,请将其添加到您的Gemfile中:
gem "sd_notify"
用法
该主要与官方实现相关,因此,请参考以详细了解通知机制的工作方式。
一个涉及虚拟工作负载的示例(假设程序作为systemd服务提供):
require "sd_notify"
puts "Hello! Booting..."
# doing some initialization work...
sleep 2
# notify systemd that we're ready
SdNotify . ready
sum = 0
5 . times do | i |
# doi
【文件预览】:
ruby-sdnotify-master
----.gitignore(33B)
----.travis.yml(196B)
----.rubocop.yml(233B)
----LICENSE(1KB)
----CHANGELOG.md(327B)
----README.md(2KB)
----lib()
--------sd_notify.rb(3KB)
----sd_notify.gemspec(708B)
----Gemfile(70B)
----test()
--------sd_notify_test.rb(1KB)