Comments (5)
I believe this is now supported as of #23. Thanks. Closing.
from tiny-redis.
Hey,
Thanks for putting your time into this. This would be a great addition. I happened to peek into your fork, just to get a feel of the work. Good progress!
I'd like to share a quick thought on this. I intend to keep this library thread free. Any introduction of threads means it will require careful consideration on the user's part to use it, especially as a lower level abstraction for higher tools. I don't want to limit the audience this way.
My idea for SUBSCRIBE would be to create a separate Subscribe object with a 'socket.accept' loop, and just return Responses as they come in. That object can only unsubscribe. If a user intends to SUBSCRIBE and issue Redis commands they'll need to open two socket connections and deal with Threading themselves.
Thoughts?
from tiny-redis.
I agree on the "no threads" approach. It pushes the baggage up a level to the application developer.
I took a survey of other client libs out there and it seems they range the expanse from super simple (incomplete) all the way to over the top with async, sync, etc... and some require an external event lib. To keep with the spirit of Redis I think it makes sense to keep it lightweight and simple with few dependencies and easy inspection of how it works.
from tiny-redis.
Any news about this implementation? It would be a great extension to have PUB/SUB support e.g. to implement microservices, etc. Keep the good work 👍
from tiny-redis.
I made something (not completely in the spirit of single threaded design desired by the author). At the end of the day, I found the author maybe was on to something. Due to thread-local constraints, sharing data between threads is a problem in the current design. I thought originally I could use Fibers or Threads, but ran into numerous design issues trying this route. I think the above comment from the author suggests the right approach . Others who know D better than I may suggest how to get an alternative working.
from tiny-redis.
Related Issues (20)
- Dub package HOT 1
- Op cast failure for EXISTS HOT 2
- Hangs on empty string responses HOT 1
- New version for pubsub support HOT 2
- Push new version to code.dlang.org
- Test cases fail on older gdc versions (4.9.0, dmdfe 2.065) HOT 5
- Is there any way to close a redis connection? HOT 4
- PubSub example on https://github.com/adilbaig/Tiny-Redis has some bugs
- Please provide an example how to pub sub in a non busy loop way
- Do not work with SCAN HOT 1
- `SCAN` very strange issue HOT 1
- Dub release HOT 2
- build on Windows package tinyredis-2.1.1 Error: undefined identifier `EWOULDBLOCK` dmd failed with exit code 1 HOT 1
- Error on template instance HOT 3
- Error and semver consideration HOT 1
- TLS support missing HOT 1
- Error: cannot uniquely infer foreach argument types HOT 4
- Typos in web page example html (not in repo itself) HOT 3
- binary strings HOT 2
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 tiny-redis.