Class: RobotLab::RactorJob

Inherits:
Data
  • Object
show all
Defined in:
lib/robot_lab/ractor_job.rb

Overview

Carrier for work crossing a Ractor boundary.

All fields must be Ractor-shareable (frozen Data, frozen String, frozen Hash, or a RactorQueue). Build with RactorBoundary.freeze_deep on the payload before constructing.

Examples:

job = RactorJob.new(
  id:          SecureRandom.uuid.freeze,
  type:        :tool,
  payload:     RactorBoundary.freeze_deep({ tool_class: "MyTool", args: { x: 1 } }),
  reply_queue: RactorQueue.new(capacity: 1)
)

Instance Attribute Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



17
18
19
# File 'lib/robot_lab/ractor_job.rb', line 17

def id
  @id
end

#payloadObject (readonly)

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



17
18
19
# File 'lib/robot_lab/ractor_job.rb', line 17

def payload
  @payload
end

#reply_queueObject (readonly)

Returns the value of attribute reply_queue

Returns:

  • (Object)

    the current value of reply_queue



17
18
19
# File 'lib/robot_lab/ractor_job.rb', line 17

def reply_queue
  @reply_queue
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



17
18
19
# File 'lib/robot_lab/ractor_job.rb', line 17

def type
  @type
end