Coder Social home page Coder Social logo

Async access to redis about pistache HOT 1 OPEN

pablin87 avatar pablin87 commented on September 17, 2024
Async access to redis

from pistache.

Comments (1)

oktal avatar oktal commented on September 17, 2024

Hello Pablo,

First of all, Pistache really does not have anything to do with redis as its job is to serve http requests only.

Now, to answer your question more deeply, yes, it is possible to access a Redis database asynchronously through hiredis. To give you a little more insight on that, I especially implemented the Reactor system with that in mind. I wanted to give users a way to plug their custom asynchronous logic through Pistache's event-loop. For example, let's say that you have a fd that represents a TCP connection to a Redis database and would like to be notified when something happens to that FD (when it becomes readable because a command returned data). You could use the Reactor provided by Pistache to insert your fd in Pistache's event-loop in Polling::Read mode and then install your own Handler to handle events from that FD.

Now, for that to work, I would need to fix issues discovered by #20 (comment)

Let me know if you would be interested in working on that (providing a sample Redis asynchronous API sample use-able through the Pistache's event-loop), as it would be a great example on how to use the Reactor for your own use-cases.

from pistache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.