Lite Cable

Services & Skills

Share on

Lite Cable provides Connection and Channel abstractions to design real-time features in your application:

class Connection < LiteCable::Connection::Base
  def connect
    # perform authentication here
  end
end

class ChatChannel < LiteCable::Channel::Base
  # Use this id in your client to create subscriptions
  identifier :chat
end

At the client-side, you can use any Action Cable library (including the official Rails one).

Lite Cable is designed to be used with AnyCable. All you need to do is configure the connection factory for AnyCable:

AnyCable.connection_factory = Connection

Alternatively, you can use a simple Rack-based WebSocket server implementation which comes with the library:

require "lite_cable/server"

Rack::Builder.new do
  map "/cable" do
    # You have to specify your app's connection class
    use LiteCable::Server::Middleware, connection_class: Connection
    run proc { |_| [200, {"Content-Type" => "text/plain"}, ["OK"]] }
  end
end
Author

In the same orbit

Explore more open source projects

How can we help you?

Martians at a glance
17
years in business

We transform growth-stage startups into unicorns, build developer tools, and create open source products.

If you prefer email, write to us at surrender@evilmartians.com