hubotio / hubot-redis-brain

A hubot script to persist hubot's brain using redis
69 stars 55 forks source link

Determining whether the brain has been loaded in other scripts #7

Closed optical closed 9 years ago

optical commented 9 years ago

I've been developing a script which stores data within hubots brain, which is backed by redis. At startup I'd like to be able to load my data from the brain and setup some hooks and so forth based on this data.

The problem I am having is that there doesn't seem to be any way to determine whether redis-brain has successfully loaded up the contents of the store. Ideally it'd be possible determine whether the brain has been loaded, and be notified when this occurs.

optical commented 9 years ago

Turns out brain.on('loaded', function() {}); was what I was after :)