Pulsar: Pulsar class

Description Usage Arguments Format Value Examples

Description

Pulsar class

Usage

1

Arguments

connection

Pulsar host and port (format: "hostname:port")

topic

Full name of the topic including persistence, tenant, namespace and pub/sub name

onMessageFct

Function invoked when when receiving message

Format

An object of class R6ClassGenerator of length 24.

Value

a Pulsar connection object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
producer <- Pulsar$new("localhost:8080", "persistent/public/default/my-topic")
producer$send("hello")

onMsg = function(payload) {
  cat("Received string:", rawToChar(payload), "\n")
  TRUE
}
consumer <- Pulsar$new("localhost:8080", "persistent/public/default/my-topic/my-sub",
                       onMessageFct = onMsg)

## End(Not run)

bbonnin/rpulsar documentation built on Oct. 11, 2018, 12:23 a.m.