
ActionCable & WebSockets
Real-time features, channels, subscriptions, broadcasting, cable.yml configuration, Redis adapter
1What is ActionCable in Ruby on Rails?
What is ActionCable in Ruby on Rails?
Відповідь
ActionCable is a framework built into Rails that enables real-time features via WebSockets. It provides a server-side abstraction in Ruby and a client-side abstraction in JavaScript to establish persistent bidirectional connections between the browser and the server. ActionCable integrates naturally with the rest of the Rails application, allowing access to models and other components.
2Which configuration file defines the adapter used by ActionCable for pub/sub?
Which configuration file defines the adapter used by ActionCable for pub/sub?
Відповідь
The cable.yml file located in config/ defines the pub/sub adapter used by ActionCable. This file specifies different adapters per environment: async for development (in-memory, single-process), redis or postgresql for production (enabling communication across multiple processes/servers). The configuration typically includes the Redis server URL and the channel to use.
3In which directory are ActionCable server-side channels typically placed?
In which directory are ActionCable server-side channels typically placed?
Відповідь
ActionCable server-side channels are placed in app/channels/. This directory contains ApplicationCable::Connection (connection management and authentication) and ApplicationCable::Channel (base class for all channels). Custom channels inherit from ApplicationCable::Channel and define the business logic for each type of real-time communication.
Which method should be used in a channel to subscribe to a message stream identified by a string?
What is the difference between stream_from and stream_for in ActionCable?
+15 питань зі співбесід
Інші теми співбесід Ruby on Rails
Ruby Basics
Ruby Object-Oriented Programming
Rails Fundamentals
Routing & Controllers
ActiveRecord Basics
Views & ERB Templates
ActiveRecord Associations
Advanced ActiveRecord Queries
Rails Forms
Authentication & Authorization
Modern Asset Pipeline & Frontend
Rails API Mode
Testing with RSpec
ActiveJob & Background Jobs
ActionMailer
ActiveStorage
Caching Strategies
Advanced Migrations
Rails Engines & Modular Apps
Performance Optimization
Rails Design Patterns
Ruby Metaprogramming
Rails Security
GraphQL with Rails
Deployment & Production
Monitoring & Logging
Rails Upgrade Strategies
Опануй Ruby on Rails для наступної співбесіди
Отримай доступ до всіх питань, flashcards, технічних тестів, вправ code review та симуляторів співбесід.
Почни безкоштовно