Giter Club home page Giter Club logo

godot's Introduction

Godot

Simple, efficient background processing for Go.

Godot uses go routine to handle many jobs at the same time in the
same process

Web UI

Requirements

redis
go 1.19+

Installation

go get github.com/easedot/godot

Getting Started

Step1

Write doters , doters/doters.go

Step2

Write job servers, examples/examples_srv.go

Step3

Write run job task, examples/examples_cli.go

Step4

go build example/example_srv.go

go build example/example_cli.go

Step5

open new termial run
docker-compose up -d

open new termial run     
./example_srv -m 50

open new termial run
./example_cli -m 5000

Config

//set queue weight
var queues = []godot.Queue{
	{Name: "work1", Weight: 3},
	{Name: "work2", Weight: 2},
	{Name: "work3", Weight: 1},
	{Name: "default", Weight: 1},
}

//set dots to 1000 goroutine 
godotSRV := godot.NewGoDot(ctx, client, queues, 50, 6698)

//set job option and register
options := Doter{
	Queue:      "default",
	Retry:      false,
	RetryCount: 2,
}
doter := defaultDoter{options}
Register(doter, options)

client.Run(ctx, "defaultDoter", "test_at")
//or run after 1000ms
client.RunAt(ctx, 1000, "defaultDoter", "test_at")

Todo

dashboard localhost:6698

Web UI

Performance

Macbook M1 Pro  
10 process 1m27s put 500000 jobs 
./example_cli -m 50000

one server, 2000 redis conn, 30s done.
./example_srv -m 2000

License

Please see LICENSE.txt for licensing details.

Author

Haihui Jiang @easedot

godot's People

Contributors

easecell avatar easedot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

boyquotes

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.