You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% bun test-ioredis.js
connection ready
connection disconnecting
connection disconnected
connection ended
% bun test-net.js
connect
ready
end
close
What do you see instead?
% bun test-ioredis.js
connection ready
connection disconnecting
connection disconnected
% bun test-net.js
close
close
Additional information
I was wondering, it seems that ioredis is implemented using the node:net module underneath. I suspect that the event emiter of Bun environment might be missing something event or it's logic differs.
In other words, the "connect", "ready" and "end" event is not emitted.
Why is this important
There are circumstances when you need to know that a connection has indeed been disconnected. For example, say you have a blocking command that is running and you need to close without waiting for said command, then you can issue a call to disconnect, and we would like to know has been disconnected. Furthermore, according to the documentation it should work, and also it works in the first case (because by the time we try to disconnect the connection is not ready yet).
The text was updated successfully, but these errors were encountered:
What version of Bun is running?
1.0.7
What platform is your computer?
Darwin 22.1.0 x86_64 i386
What steps can reproduce the bug?
Below are the execution results for following of code, one using Node.js (v18.18.2) and the other using Bun (v1.0.7).
1. Using the IORedis library
test-ioredis.js
Node.js (v18.18.2)
Bun (v1.0.7)
2. Using the Node.js net module
test-net.js
Node.js (v18.18.2)
Bun (v1.0.7)
What is the expected behavior?
What do you see instead?
Additional information
I was wondering, it seems that ioredis is implemented using the
node:net
module underneath. I suspect that the event emiter of Bun environment might be missing something event or it's logic differs.Why is this important
There are circumstances when you need to know that a connection has indeed been disconnected. For example, say you have a blocking command that is running and you need to close without waiting for said command, then you can issue a call to disconnect, and we would like to know has been disconnected. Furthermore, according to the documentation it should work, and also it works in the first case (because by the time we try to disconnect the connection is not ready yet).
The text was updated successfully, but these errors were encountered: