heartbeat_send_signal: Send a signal

Description Usage Arguments Examples

View source: R/heartbeat.R

Description

Sends a signal to a heartbeat process that is using key key

Usage

1
heartbeat_send_signal(con, key, signal)

Arguments

con

A hiredis object

key

The heartbeat key

signal

A signal to send (e.g. tools::SIGINT or tools::SIGKILL)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
if (redux::redis_available()) {
  rand_str <- function() {
    paste(sample(letters, 20, TRUE), collapse = "")
  }
  # Suppose we have a process that exposes a heartbeat running on
  # this key:
  key <- sprintf("heartbeatr:test:%s", rand_str())

  # We can send it an interrupt over redis using:
  con <- redux::hiredis()
  heartbeatr::heartbeat_send_signal(con, key, tools::SIGINT)
}

richfitz/heartbeatr documentation built on April 17, 2021, 8:54 p.m.