# NOT RUN {
topology <- Topology(data.frame(x=rnorm(100,0,1)))
computeSum <- function(x, ...){
sum <- GetHash("sum")
if(is.data.frame(sum)){
x <- sum + (x[1])
}
SetHash("sum", x)
}
topology <- AddBolt(topology, Bolt(computeSum))
result <- RStorm(topology)
print(GetHash("sum", result))
# }
Run the code above in your browser using DataLab