Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 1.02 KB

File metadata and controls

49 lines (37 loc) · 1.02 KB
title Vendor extensions
sdk ruby
kind guide
order 50
spec_sections
§5.1
§8.2
§15

Vendor extensions

Event kinds prefixed x-vendor. carry implementation-specific data. The runtime forwards them verbatim; clients that don't recognize the prefix ignore them.

Namespace conventions

  • x-vendor.<org>.<event> — owned by <org>
  • Bodies are arbitrary JSON-serializable Hashes
  • Standard kinds (without the x-vendor. prefix) are reserved

Emit from a handler

ctx.emit(
  kind: 'x-vendor.acme.progress',
  body: { 'stage' => 'mapping', 'percent' => 50 }
)

Receive on a client

Unknown kinds round-trip through Arcp::Job::Event with a frozen Hash body — no EventBody class is allocated.

handle.subscribe(client: client).each do |event|
  if event.kind.start_with?('x-vendor.acme.')
    stage = event.body['stage']
    pct   = event.body['percent']
    puts "#{stage}: #{pct}%"
  end
end

event.known? returns false for vendor kinds.

See also

  • guides/job-events.md