Zizq.JobPage (Zizq v0.6.1)

Copy Markdown View Source

One page of a job listing, and where the next one is.

Returned by Zizq.list_jobs/2. Follow it with Zizq.next_page/2, which returns nil once there are no more:

{:ok, page} = Zizq.list_jobs([queue: "emails"], MyApp.Zizq)

case Zizq.next_page(page, MyApp.Zizq) do
  {:ok, nil} -> :done
  {:ok, next} -> handle(next)
end

The links are opaque paths the server builds, carrying the cursor and every filter of the original request.

Follow Zizq.prev_page/2 to go the other direction.

Summary

Functions

Whether another page follows this one.

Whether a page precedes this one.

Types

t()

@type t() :: %Zizq.JobPage{
  jobs: [Zizq.Job.t()],
  next: String.t() | nil,
  prev: String.t() | nil,
  self: String.t() | nil
}

Functions

has_next?(job_page)

@spec has_next?(t()) :: boolean()

Whether another page follows this one.

has_prev?(job_page)

@spec has_prev?(t()) :: boolean()

Whether a page precedes this one.