Coder Social home page Coder Social logo

wombat's Introduction

Wombat Task Queue

Wombat Task Queue, an open-source task queue service built with Go and leveraging MongoDB for storage, is engineered to simplify task management and processing in distributed applications. Supports prioritization.

Planned Features

  • Task Prioritization: Assign priority levels to tasks for processing.
  • Stale Task Handling: Automatically remove tasks that have been pending for too long.
  • Task Metrics: Track task processing times and success rates.
  • gRPC Support: Use gRPC for communication.

Usage

Installation

  1. Clone the repository:
git clone https://github.com/xis/wombat.git
  1. Navigate to the project directory:
cd wombat
  1. Build the project:
go build -o wombat ./cmd

Usage

Setting Up Environment Variables

Wombat uses environment variables for configuration. Before starting the service, ensure you have set the following variables:

  • MONGO_URI: The connection string to your MongoDB instance.
  • HTTP_ADDR: The HTTP address and port the service will listen on (default: :8080).

Starting the Service

To start the Wombat service, run:

./wombat

API Endpoints

Wombat provides the following RESTful API endpoints for managing tasks within queues:

  • GET /queues/:queueID/tasks: Retrieve pending tasks from a specific queue.
  • POST /queues/:queueID/tasks?priority=8: Create a new task in a specific queue. The request body must be a JSON.
    • Here is an example of a request body:
      {
        "user_id": 8,
        "video-url-to-process": ".../australia.mp4"
      }
  • PUT /queues/:queueID/tasks/:taskID: Update the status of a specific task.
    • Here is an example of a request body:
      {
        "status": "completed"
      }

Task Prioritization

When creating a new task, you can specify a priority level. The higher the number, the higher the priority. If no priority is specified, the task will default to priority level 0.

Development

For developing on Wombat, you will need a Go development environment set up and an accessible MongoDB instance for testing.

Contributing

Contributions are welcome! If you'd like to contribute, please fork the repository and create a pull request with your changes. For major changes, please open an issue first to discuss what you would like to change.

License

Distributed under the MIT License. See LICENSE for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.