在文档示例中,我们可以看到:
var Queue = require('firebase-queue'),
Firebase = require('firebase');
var ref = new Firebase('https://<your-firebase>.firebaseio.com');
var queueRef = ref.child('queue');
var messagesRef = ref.child('messages');
var options = {
'specId': 'new_user'
};
new Queue(queueRef, options, function(data, progress, resolve, reject) {
// sanitize input message
console.log(data.message);
// pass sanitized message and username along to be fanned out
resolve(data);
});
new_user
如何使用 specId或其他自定义保存新任务specId
var task = {'userId': "0338ba4d-191f-4044-9af0-4c76f47aeef9"};
ref.child("queue").child("tasks").push(task);
此推送不会触发队列。如果我options
从队列中删除,它确实有效(当然)