JobContext.fromRequest constructor

JobContext.fromRequest(
  1. ServerMessage msg
)

Create an Event context from a server message.

Implementation

factory JobContext.fromRequest($jp.ServerMessage msg) {
  var payload = Proto.mapFromStruct(msg.jobRequest.data.struct);

  return JobContext(
    msg.id,
    JobRequest(
      msg.jobRequest.jobName,
      payload,
    ),
    JobResponse(),
  );
}