# README
Implementing GoCable
Resources
- Using
anycable
gem in non-Rails apps useful to understand how it hooks into an application with a simpler example than Rails itself. - Test connection factory shows protocol responses etc.
- Ruby Socket/State implementation
- Ruby RPC handler implementation
Tools
brew install protobuf
gem install anyt
brew install bradleyjkemp/formulae/grpc-tools
Development flow
buffalo dev # reloading
Runnig tests:
anyt -c "anycable-go --debug --headers cookie,x-api-token --broadcast_adapter http" \
--target-url="ws://localhost:8080/cable" --skip-rpc
Getting debug output from anycable-go:
anycable-go --debug --headers cookie,x-api-token --broadcast_adapter http
Running a specific test:
anyt -c "sleep 99999999" --target-url="ws://localhost:8080/cable" --skip-rpc --only welcome_test
NOTE: server_restart_test will fail with anycable-go running as a separate process because anyt won't be able to kill the process.
TODO
-
Pass all anyt tests
- multiple_clients_test.rb:33
- multiple_clients_test.rb:44
- stop_test.rb:40
- features/remote_disconnect_test.rb:13
- server_restart_test.rb:22 anyt -c "anycable-go --debug --broadcast_adapter http" --target-url="ws://localhost:8080/cable" --skip-rpc --only server_restart_test
- channel_state_test.rb
-
Simple chat
-
Estimate what would it take to skip RPC + HTTP broadcast.
-
Embed anycable
- Controller implementation
- Start node with minimal dependencies
- Call HandlePubSub or, better, Broadcast when broadcasting.
-
Anyt tests pass for standalone server
-
Simplified DSL for chat
-
Create a library
- Rename
- Restructure code under anycable/
- Gin example in example/chat
- README
- Quick start
- Write minimal integration test app w/o buffalo.
-
Use in Rally
- Show which uexternalser is online
-
Rewrite anyt tests in Go https://github.com/posener/wstest
-
Docstrings for everything
-
Address all TODOs
-
Contribute http broadcast adapter to anyt
AnyCable.config.broadcast_adapter = :http AnyCable.config.http_broadcast_url = 'http://localhost:8090/_broadcast'
-
Redis broadcast adapter