Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
squarism

Redis client for OpenComputers

Recommended Posts

I made a redis client (lol).  It's pretty alpha I think.  Here's the repo:  https://github.com/squarism/opencomputers_redis

local redis = require("redis")
client = redis.connection('opencomputers://localhost:6379')

-- change databases
client:select(11)

-- basic usage
client:set("redis", "awesome")

This will store "awesome" in the "redis" key in the real-world redis server on localhost.  Of course you need an Internet card and some other setup.  It's in the README and if it's not it should be and that's a bug.  :)

 

You have to unblacklist localhost in this case.  The other details are in the README.  If you are asking "whyyyyyy" or yelling "staaahp".  First, calm down bro.   :)  Second, I'm using this to pump metrics into statsd and then putting that into a real metrics system.  Redis in this case is a simple database for OC.  I'd love to have redis or something inside of minecraft but that's porting C to Lua (eesh).  Getting a redis client was tricky enough.  Most of the code is not mine (credited) but the trick was to attach to a fake OC socket.  Crazy.

 

I'm attaching a screenshot but for those of you coming from Google and not able to see screenshots, here's a tweet with a screenshot of the metrics thing:

 

https://twitter.com/squarism/status/575927329932759040

post-1826-0-11101700-1427344094_thumb.png

 

(very complicated setup, post if you are interested)

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.