soh*_*ifa 33
不了解"活跃"订阅.
但是有一个对象 Meteor.default_connection._subscriptions存储已经订阅直到给定时间的所有订阅的信息.
var subs = Meteor.default_connection._subscriptions; //all the subscriptions that have been subscribed.
Object.keys(subs).forEach(function(key) {
console.log(subs[key]); // see them in console.
});
Run Code Online (Sandbox Code Playgroud)
不完全是你想要的.
作为对上述内容的补充,我们可以以一种更容易检查多个订阅等的方式组织它们。
//all the subscriptions that have been subscribed.
var subs = Meteor.default_connection._subscriptions;
var subSummary = {};
// organize them by name so that you can see multiple occurrences
Object.keys(subs).forEach(function(key) {
var sub = subs[key];
// you could filter out subs by the 'active' property if you need to
if (subSummary[sub.name] && subSummary[sub.name].length>0) {
subSummary[sub.name].push(sub);
} else {
subSummary[sub.name] = [sub];
}
});
console.log(subSummary);
Run Code Online (Sandbox Code Playgroud)
请注意,您可以看到“就绪”状态以及订阅中使用的参数。
| 归档时间: |
|
| 查看次数: |
4086 次 |
| 最近记录: |