Skip to content

brugnara/background-job-system

Repository files navigation

Background Job System

https://www.codementor.io/projects/background-job-system-atx32exogo

How to use

Start the server:

go run *.go

This will start both the webserver and the jobs handler.

Web page

Open your preferred browser, reach the page localhost:8081.

In this page, you can insert a job.

What do you mean with 'job'?

A job is composed by some parameters.

  • a payload
  • a payload content-type
  • an endpoint
  • a HTTP status code
  • a due date
  • and a friendly name for your eyes

Payload

A payload is what you need to elaborate. Ideally a JSON but you could send whatever you need.

Payload Content-Type

The receiving server will be more happy if you tell it what kind of payload you are going to send to it. Defaults to application/json, change if needed.

Endpoint

The server who will receive this job and will digest. Jep, because this is a forwarding server only. The dirty work is made by endpoints.

What, don't you have an endpoint to use for testing this? I'll tell you a secret. The folder /_listener contains a dummy web server ;)

HTTP Status Code

The job handler will flag as done a job if the endpoint returns a HTTP Status Code like the one you want.

Due date

This is the time when you want your job to be sent to the endpoint. Could be any date, even in two years. The job will be stored and execute when the time comes. You can also set a date in the past and the job will run ASAP.

Name

This is for you. In the background, an UUID will be generated and used.

Jobs page

Here, with a paginator made both on server and client side, you will see everything you need to see. Select a job if you want to delete or run ASAP.

ASAP?

What do I mean with ASAP? As soon as possible, in this server means as far as the tick clocks, and this happens every minute.

Database

For this test, Sqlite3 is used.

Tests

Todo ASAP.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages