Giter VIP home page Giter VIP logo

socket.io-rethinkdb's Introduction

socket.io-rethinkdb

Build Status npm version

How to use

var io = require('socket.io')(3000);
var rethinkdb = require('socket.io-rethinkdb');
io.adapter(redis({ host: 'localhost', port: 28015 }));

API

adapter(uri[, opts])

uri is a string like localhost:28015 where your rehtinkdb instance is located. For a list of options see below.

adapter(opts)

The following options are allowed:

  • host: host to connect to redis on (localhost)
  • port: port to connect to redis on (28015)
  • db: database in which to store messages (socketio_rethinkdb)
  • save_messages: whether the database should keep sent message (or delete them automatically) (false)
  • durability_hard: whether messages have to be written to disk before being acknowledged (false)

When to use

Because of the differences between Redis and RethinkDB, it's not best to use this driver over socket.io-redis. Redis' pub/sub mechanism (which socket.io-redis uses) is not persistent and doesn't save your messages to the database. For that reasons, it's faster and can handle more messages being concurrently saved to it.

Hence, you should use this module instead of socket.io-redis if:

  1. RethinkDB is alreaydy part of your stack and you don't want another database
  2. You need your messages to be persistent

Guarantees

Messages broadcasted/emitted through the socket connection are guaranteed to be written, if acknowledged. But, because of the nature of changefeeds, messages are not guaranteed to be delivered. This is similar to the guarantees currently provided by Redis pub/sub and socket.io-redis.

Credit

This module is a fork of socket.io-redis.

License

MIT

socket.io-rethinkdb's People

Contributors

barisusakli avatar basarat avatar hannesvdvreken avatar kevin-roark avatar krinkle avatar nkzawa avatar rase- avatar rauchg avatar reqshark avatar siedrix avatar thejsj avatar

Watchers

 avatar  avatar  avatar

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.