8000 GitHub - nerdyworm/fox: postgres backed queue for gleam
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

nerdyworm/fox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fox

Package Version Hex Docs

gleam add fox
import fox

pub fn main() {
  let queue =
    fox.new("default", your_pgo_connection)
    |> fox.register("name", fn(args) {
      io.debug(args)
      fox.ack()
    })

  let assert Ok(_) =
    queue
    |> fox.start_link()

  fox.push(queue, "name", "args here")
}

Further documentation can be found at https://hexdocs.pm/fox.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell
CREATE TABLE fox_jobs (
  id bigserial primary key not null,
  state text not null default 'available',
  queue text not null,
  worker text not null,
  args jsonb not null default '{}'::jsonb,
  errors jsonb not null default '[]'::jsonb,
  attempt integer not null default 0,
  max_attempts integer not null default 10,
  inserted_at timestamp without time zone not null default (now() at time zone 'utc'),
  scheduled_at timestamp without time zone not null default (now() at time zone 'utc'),
  completed_at timestamp without time zone
);

;;

create index idx_fox_jobs ON fox_jobs(state, queue, scheduled_at, id);

About

postgres backed queue for gleam

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0