Comments (4)
It might be related to #390
from redis.
Yes, I am not noticing this issue anymore, this issue can be closed.
from redis.
Thanks for reporting the issue @dionjwa!
? do I unsubscribe here? It doesn't seem to help
No, it is not unsubscribed if it just exits the loop.
What is the correct expected pattern to
subscribe
->unsubscribe
->subscribe
again to the same key?
The following code seemed to work properly. If possible, could you share the code that is causing the problem? I would like to look into it.
import { connect } from "./redis.ts";
import { assertEquals } from "./vendor/https/deno.land/std/assert/mod.ts";
const opts = {
hostname: "127.0.0.1",
port: 6379
};
const redis = await connect(opts);
const pub = await connect(opts);
const channel = "foobar";
const sub = await redis.subscribe(channel);
const messages = [];
try {
const promise = (async () => {
for await (const m of sub.receive()) {
messages.push(m);
break;
}
})();
await pub.publish(channel, "message");
await promise;
await sub.unsubscribe(channel);
await sub.subscribe(channel);
const promise2 = (async () => {
for await (const m of sub.receive()) {
messages.push(m);
break;
}
})();
await pub.publish(channel, "message 2");
await promise2;
} finally {
sub.close();
redis.close();
pub.close();
}
assertEquals(messages, [
{ channel, message: "message" },
{ channel, message: "message 2" }
]);
from redis.
P.S. I believe #390 has been resolved in v0.32.1. Maybe this problem has also been resolved.
from redis.
Related Issues (20)
- [feat] keepalive feature
- [feat] automatically reconnect when interrupted
- Bug: xrange failed to parse empty string
- deps: import `cluster-key-slot` and `lodash-es` from esm.sh
- Support for RedisJson - JSON.GET
- Support AbortController in a client HOT 1
- Watch vs tx HOT 1
- Subscribe / psubscribe hangs after calling sub.receive() HOT 1
- `Redis.scan` cursor parameter requires a number
- sendCommand api inconsistency HOT 1
- Property 'set' does not exist on type 'Redis'.deno-ts(2339) HOT 5
- Parallel Request Issue HOT 1
- feat: Auto-pipelining
- feat: Connection pooling
- Errors on concurrent pipeline invocation HOT 3
- Sentinel Support
- Hang up on auto reconnect HOT 1
- Roadmap to v1
- Publish to JSR
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis.