ra1u / redis-dart

fast redis protocol parser and client
MIT License
84 stars 35 forks source link

fix:used universal_io instead of dart:io to support web platform #97

Closed dhanrajmahurkar closed 6 months ago

dhanrajmahurkar commented 6 months ago

current implementation does not allow redis pub/sub to work on web (chrome/web-server). By using universal_io instead of dart:io we can fix this issue

ra1u commented 6 months ago

Hi @dhanrajmahurkar

We currently have method connectWithSocket and this is something you can start with.

Additionaly, lowest abstraction needed here is actually just Stream but we dont support it right now. You can start and add method connectWithStream in similar way as it is connectWithSocket.

After having connectWithStream you can abstract your protocol to allow sending relevant payload data as Stream, you should be fine.with any kind of overlay connection.

ra1u commented 6 months ago

My mistake here.

One reason that we can not use only Stream in this library currently, is that there is no method add for Stream and one can not send data to stream. There is however CustomStream , that lives in async world only, but there is no much of use of it.

In general out of the box, you should be able to work with any class that looks like a Stream (Socket as of now), but has additional add and close methods.