toniq icon indicating copy to clipboard operation
toniq copied to clipboard

Create %Toniq.Job{} struct instead using a map

Open oscarolbe opened this issue 6 years ago • 0 comments

The Job structure is used internally. Invoking the methods of enqueue is the same way.

The only change would be in the struct result.

> Toniq.enqueue(TestWorker, [name: "Joe"])
%Toniq.Job {arguments: [name: "Joe"],
  error: nil, id: 7, options: nil, version: 1,
  vm: "2be749b8-5ae7-11e8-a08f-4c327598015b", worker: TestWorker}

instead of the map

> Toniq.enqueue(TestWorker, [name: "Joe"])
%{arguments: [name: "Joe"], id: 7, version: 1,
 vm: "2be749b8-5ae7-11e8-a08f-4c327598015b", worker: TestWorker}

Using this structure I will create an adapter for JobPersistance

oscarolbe avatar May 18 '18 22:05 oscarolbe