Module: Async::Background::Web::Cursor

Defined in:
lib/async/background/web/cursor.rb

Class Method Summary collapse

Class Method Details

.decode_finished(value) ⇒ Object



19
20
21
22
23
24
# File 'lib/async/background/web/cursor.rb', line 19

def decode_finished(value)
  timestamp, id = decode(value)
  return unless timestamp

  {finished_at: timestamp, id: id}
end

.decode_pending(value) ⇒ Object



26
27
28
29
30
31
# File 'lib/async/background/web/cursor.rb', line 26

def decode_pending(value)
  timestamp, id = decode(value)
  return unless timestamp

  {run_at: timestamp, id: id}
end

.encode_finished(finished_at, id) ⇒ Object



11
12
13
# File 'lib/async/background/web/cursor.rb', line 11

def encode_finished(finished_at, id)
  encode(finished_at, id)
end

.encode_pending(run_at, id) ⇒ Object



15
16
17
# File 'lib/async/background/web/cursor.rb', line 15

def encode_pending(run_at, id)
  encode(run_at, id)
end