Open-Source Wikis

/

GitLab

/

Apps

/

Action Cable

gitlab-org/gitlab

Action Cable

Real-time websocket pub/sub for the web UI: live updates on issues, MRs, pipeline status, build traces, Duo Chat streaming, and merge request review collaboration.

Purpose

Push server-originated updates to the browser without polling.

Source layout

app/channels/
├── application_cable/      # Connection + base channel
├── awareness_channel.rb    # Co-author presence
├── graphql_channel.rb      # GraphQL subscriptions over Cable
├── issues_channel.rb
├── merge_requests_channel.rb
├── notes_channel.rb        # Live comment threads
└── ...
ee/app/channels/             # EE-only channels (incident-management, geo, ai-conversations)
config/cable.yml.example     # adapter config (Redis pubsub by default)

How it integrates

graph LR
    Browser -->|websocket| WH[Workhorse]
    WH -->|forward| Cable[ActionCable]
    Cable -->|pub/sub| Redis[(Redis)]
    Producer[Rails or Sidekiq] -->|publish| Redis
  • The browser opens a websocket to /-/cable. Workhorse hijacks the connection and proxies it to the Action Cable server (which runs in-process under Puma in most installs).
  • A producer on the server side publishes via ActionCable.server.broadcast or via GraphQL subscription triggers (app/graphql/graphql_triggers.rb).
  • Subscribers in the browser receive messages and update Vuex/Apollo state.

Connection authentication

app/channels/application_cable/connection.rb resolves the user from the cookie/session and sets current_user. From there, app/channels/application_cable/channel.rb provides shared helpers used by domain channels.

GraphQL subscriptions

app/graphql/graphql_triggers.rb exposes triggers like issue_updated(issue), merge_request_updated(merge_request). The GraphqlChannel (app/channels/graphql_channel.rb) routes incoming subscription requests to the schema and emits results when the trigger fires.

EE additions

ee/app/channels/ adds:

  • Geo::SyncChannel — secondary site progress.
  • IncidentManagement::PagerDutyChannel, etc.
  • AI conversation channels for Duo Chat streaming.

Scaling

Action Cable can run in-process (default) or as a separate process. The pub/sub backplane is Redis. For very high subscriber counts, GitLab.com runs a dedicated Action Cable cluster.

Testing

  • Channel specs live under spec/channels/.
  • They use ActionCable::Channel::TestCase patterns.
  • Connection auth specs in spec/channels/application_cable/connection_spec.rb.
  • GraphQL API — subscriptions piped through Action Cable.
  • Workhorse — proxies the websocket to Cable.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Action Cable – GitLab wiki | Factory