Code Monkey home page Code Monkey logo

libyrmcds's People

Contributors

chobie avatar devnexen avatar kazuho avatar nojima avatar toshipp avatar ymmt2005 avatar yonex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libyrmcds's Issues

Clean way to shutdown the receiver thread?

README.md states:

Although the socket used in libyrmcds is blocking, receiving results from the server is separated from the sending operations. You can even use a different thread to receive results asynchronously.

The design is elegant, works like a charm. However it seems like that there is no way to gracefully shutdown the receiver thread.

IMO, yrmcds_recv function should return (presumably with an error code like YRMCDS_INTERRUPTED) when recv(2) returns EINTR, so that applications can do whatever they want.

Make dependency to lz4 optional

Now, libyrmcds always links to LZ4, however it is often the case that the application needs to compression at all.

It would be great if the dependency could be optionally turned off at compile time.

Rename portability.h

It would be great if portability.h gets renamed to yrmcds_portability.h or something, since the file is internal to libyrmcds.

To use libyrmcds we need to add source directory of libyrmcds to the include paths (since it is the directory that contains yrmcds.h). The existence of portability.h in the same directory means that there would be a conflict if user has a header file with the same name.

This is kind of a nit-pick (and I am not suffering from the issue).

Portability on Solaris

portability.h breaks on Solaris/SmartOS/Illumos as it assumes !(OSX || Linux) => BSD.
Solaris does not have sys/endian.h.
The patch below fixes this. I am using the macros {BE|LE}_IN{16|32|64} from Solaris' sys/byteorder.h which are a bit slower but can deal with unaligned access as the values might be read from a network buffer and not be guaranteed to be aligned on word boundaries.

--- /home/majid/portability.h.dist  Fri Sep 11 11:56:21 2015
+++ /home/majid/portability.h       Fri Sep 11 12:04:04 2015
@@ -29,6 +29,20 @@
 #  define le64toh(x) OSSwapLittleToHostInt64(x)
 #elif defined(__linux__)
 #  include <endian.h>
+#elif defined(sun) /* Solaris */
+#  include <sys/byteorder.h>
+#  define htobe16(x) BE_16(x)
+#  define htole16(x) LE_16(x)
+#  define be16toh(x) BE_IN16(x)
+#  define le16toh(x) LE_IN16(x)
+#  define htobe32(x) BE_32(x)
+#  define htole32(x) LE_32(x)
+#  define be32toh(x) BE_IN32(x)
+#  define le32toh(x) LE_IN32(x)
+#  define htobe64(x) BE_64(x)
+#  define htole64(x) LE_64(x)
+#  define be64toh(x) BE_IN64(x)
+#  define le64toh(x) LE_IN64(x)
 #else // *BSD
 #  include <sys/endian.h>
 #endif

Support text protocol

Currently, libyrmcds supports binary protocol only.

To support text protocol as well, these may matter:

  • Invalid keys (keys containing spaces and/or newlines).
  • Non-existent commands.
  • Differences in server response.

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.