if (FALSE) {
# MASTER SESSION:
# allocate data
}
n = 1000
m = 100
mat = matrix(rnorm(n * m), n, m) # target matrix
namespace = "ns_meta"
memshare::registerVariables(namespace, list(mat=mat))
if (FALSE) {
# WORKER SESSION:
# retrieve metadata of the variable
}
res = memshare::retrieveMetadata(namespace, "mat")
if (FALSE) {
# res$type = "matrix"
# res$nrow = 1000
# res$ncol = 100
}
releaseViews(namespace, c("mat"))
if (FALSE) {
# MASTER SESSION:
# free memory
}
memshare::releaseVariables(namespace, c("mat"))
Run the code above in your browser using DataLab