Skip to contents

Publishes several key‑value items in a single transaction. This is more efficient than publishing each item separately.

Usage

mc_publish_multi(conn, stream, items, options = NULL)

Arguments

conn

A connection object created by mc_connect.

stream

Character string. Default stream for all items (if not overridden per item).

items

A list of item objects, each containing:

  • key or keys – the key(s) for the item.

  • data – the data to publish.

  • (optional) stream – override the default stream.

options

Optional default "offchain" string.

Value

A character string containing the transaction ID.

Examples

if (FALSE) { # \dontrun{
items <- list(
  list(key = "k1", data = list(text = "item1")),
  list(key = "k2", data = list(json = list(value = 2)))
)
txid <- mc_publish_multi(conn, "mystream", items)
} # }