- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我有两个角色,医生和病人......
当患者执行操作 A 时,我希望向医生列表广播,而不是所有医生,而是他们的列表..
在我的测试中,我能够通过在 Node 中使用 redis 订阅前缀为 Doctor 和连字符然后是 UserID 的 channel 来实现此目的...
redis.subscribe('Doctor-1', function(err, count) {
});
但是,对于生产,我不能硬编码那个 ID,我需要的是像下面这样的东西
redis.subscribe('Doctor-*', function(err, count) {
});
但是通配符好像不行...
关于如何订阅通配符有什么想法吗?
最佳答案
Redis.io, PubSub Documentation
The Redis Pub/Sub implementation supports pattern matching. Clients may subscribe to glob-style patterns in order to receive all the messages sent to channel names matching a given pattern.
For instance:
PSUBSCRIBE news.*
因此您的代码段可以更改为
redis.subscribe('Doctor.*', function(err, count) {});
因此它将收到 ID 为 Doctor.1
的医生的任何信息或更深入
Doctors.<groupId>.<DoctorId>
等等。
关于node.js - Laravel 5 使用 Node 和 Laravel-Echo-Server 将事件广播到 WildCard channel ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47997319/
我们正在运行一个为我们的客户使用自定义子域的 PHP 站点,因此我们在 Apache(版本 2.2.3)中使用通配符 VHost 实现了通配符 SSL 证书。这些子域 PHP 网络应用程序还在我们的
我正在尝试创建一个 snakemake 管道,其输出由特定文件夹中存在的一组排序文件决定。我的文件路径结构如下: project_dir > Snakefile > code >
在以下示例中,将在与输入文件相同的位置创建输出文件。有没有办法获取输出部分中通配符值的基本名称,以便我可以使用输入文件的基本名称来命名输出文件,但将其写入不同的位置? infile=['/home/u
是否可以在不使用显示和隐藏类填充我的文档的情况下执行类似于以下的操作: body.vnu-hours-sel *:not(#results-content) { visibility:hid
我们有一个简单的搜索界面,它调用 search:search($query-text) 函数。是否有一种语法可以在函数接受的单个文本字符串中包含对通配符、词干提取和区分大小写的控制?我在 MarkLo
我正在使用 Twitter API 搜索帖子:GET search/tweets我用意大利语进行查询,为了使其对男性和女性都有效,我运行了两次。示例: https://api.twitter.com/
我正在尝试创建一个仅接受特定类的容器。使用泛型如下: static class Test1 { C field = null; public C
是否可以将事实插入到 Drools 工作内存中(例如查询的约束)作为通配符? 例如,假设我有以下规则: rule "meal_exceptions_1" agenda-group "MEAL"
所以我正在阅读泛型以重新熟悉这些概念,尤其是在涉及通配符的地方,因为我几乎从不使用它们或遇到它们。从我所做的阅读中,我无法理解他们为什么使用通配符。下面是我经常遇到的一个例子。 void printC
我正在尝试执行 git rm --cached -r 以递归方式删除名为 .svn 的文件夹的所有实例。我试过这个: .svn /.svn /*/.svn /*/*/.svn etc 它确实有效,但我
我是 C# 世界的新手,我正在努力研究泛型。这是我目前的问题: public Interface IAnimal{ string getType(); } public Interface IAn
我正在创建一个 RPM,它对另一个包有要求,该包名称中间有版本号。 例如 softwarepackage10.1-util-10.1.1.x86_64.rpm。名称会随下一个版本而改变,例如 soft
我想从多个位置加载键值对。我的第一个猜测是: 但它无效 Invocation of init method failed; nested exception is java.io.FileNotFo
我有以下代码段: public void reorder(int fromIndex, int toIndex) { getElements().add(toIndex, getElement
我有一个场景,我使用了一些我很熟悉的公式,但没有得到结果。我想得到单元格中存在“1”的任何结果。 (1 是公式的结果)。以及某个列的文本包含 & 的位置。 (“&/或者”) 我尝试了几个公式 =IF(
我有一个生成文件,用于构建许多相互依赖的库。我构建它们的方式总是一样的。 它可能是这样的: #Makefile all: commonprefix_lib1 commonprefix_
我试图让 git 忽略所有扩展名为 .ex 的文件,但前提是它们位于名为 subf 的子文件夹中。在 man gitignore 中我读到了以下内容: Two consecutive asterisk
我正在使用Elasticsearch6.8并在查询中使用match_phrase_prefix和wildcard。我发现它的性能很差。我在想的是手动将文本标记为一组术语。 例如,该字段具有类似于ABC
我一直在尝试用 VHDL 代码为我在 Altera DE1 板上实现的简单 16 位处理器编写有限状态机。在有限状态机中,我有一个 CASE 语句来处理不同的 16 位指令,这些指令由 16 位 ST
最近我一直在试验 EPiServerFind,我想弄清楚通配符查询是如何使用的。 我遇到了以下困难: 我的一位同事使用 EPiServerFind 设置了 POC,遗憾的是这只能搜索整个单词。例如:如
我是一名优秀的程序员,十分优秀!