git ssb

2+

cel / scuttlebot.io



Tree: 8231016cf1abf0fb60c43b11d9ef9dbe69d6e5c0

Files: 8231016cf1abf0fb60c43b11d9ef9dbe69d6e5c0 / tmpl / docs / advanced / watch-for-messages.md

699 bytesRaw

Watch for messages by all users

var pull = require('pull-stream')
pull(
  sbot.createLogStream({ live: true }),
  pull.drain(function (msg) { ... })
)
sbot log --live

→ createLogStream API

Watch for messages by a single user

var pull = require('pull-stream')
pull(
  sbot.createUserStream({ id: userId, live: true }),
  pull.drain(function (msg) { ... })
)
sbot createUserStream --id {userId} --live

Notice that pull.drain is used instead of pull.collect, so that new messages are handled immediately.

→ createUserStream API

Built with git-ssb-web