Comments (4)
@dvora-h interesting, for when we work on RESP3
from hiredis-py.
@dvora-h What do your redis-py tests show here? Does the PubSub push test in the 5.0 work in this scenario?
from hiredis-py.
@stereobutter Can you help me understand why you believe that list is more appropriate here? Given what I read in the specification, I'd have yielded a string, to handle:
Out of band data. The format is like the Array type, but the client should just check the first string element, stating the type of the out of band data, a call a callback if there is one registered for this specific type of push information. Push types are not related to replies, since they are information that the server may push at any time in the connection, so the client should keep reading if it is reading the reply of a command.
I read that as ideally it should be an array, but YMMV since you have to hit up a callback anyway. Again a List seems right.
from hiredis-py.
@chayim I am not sure I understand your question, so please excuse if my response doesn't make sense.
As I understand it the PUSH
type in RESP3 was introduced so that clients may use pub/sub on the same connection as regular commands. In RESP2 pubsub messages are array messages and thus a client could not differentiate it from a regular array reply it may be expecting (e.g. after issuing a command like HMGETALL
).
In RESP3 the array and push types only differ by the first character (>
for push messages and *
for arrays) and as such it would make sense to use a similar (but different) type on the python side. I don't see how str
would work here as a push type can have an arbitrary number of items? You are correct of course that a client would use the first item of a push message for figuring out what type of push message it is and what callback to trigger.
The spec says
RESP3 push data is represented from the point of view of the protocol exactly
like the Array type. However the first byte is>
instead of*
, and the
first element of the array is always a String item, representing the kind
of push data the server is sending to the client. All the other fields in the
push array are type dependent, which means that depending on the type string
as first argument, the remaining items will be interpreted following different
conventions.
from hiredis-py.
Related Issues (20)
- Differentiating between bool False and not-enough-data HOT 1
- Wheel support for python 3.10
- Bump hiredis version to 1.0.2 HOT 1
- New release for cp3.10 is not on pypi HOT 6
- Can not decode resp3's big number type HOT 4
- pip install failing for version 2.0.0 python 3.10 HOT 2
- Can't install hiredis HOT 2
- C99 errors with older gcc HOT 4
- Release for supporting Python 3.10 HOT 9
- Support newest hiredis release 1.1.0
- Source tarballs unavailable on pypi? HOT 5
- Changelog entry missing for 2.1.0
- Support dispatch/manual and tagged releases
- Windows wheels fail to build due to ssize_t redefinition HOT 2
- CI needs to properly account for all buildwheels attempts - at least in some labelled cases HOT 1
- sdsalloc.h doesn't seem to be installed as part of regular hiredis HOT 9
- Support garbage collection in Reader HOT 1
- Tag mismatch for 2.2.3/2.3.0 release HOT 2
- tests/test_asyncio/test_connect.py hangs on Python 3.12
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 hiredis-py.