Skip to content
/ async Public

Go 异步任务库 ⚡️ Go Async Task Library with SuperPower ⚡️

License

Notifications You must be signed in to change notification settings

Xunzhuo/async

Repository files navigation

Contributors Forks Stargazers Issues


Logo

Async

Async is a lightwight, easy-to-use, high performance, more `human-being` asynchronous go library

GoDoc Build Status CodeQL Go Report Card Coverage Status

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contacts
  8. Acknowledgments

About this Project

Async is a lightwight, easy-to-use, high performance, more human-being Asynchronous Framework

Spotlights

  • Async is very easy to use, creating the jobs just by a couple of lines.
  • Support master/slave job mode or standalone job mode
  • Provide powerful options to control the jobs like the MaxNumber of WorkQueue.
  • Provide inner cache to speed up to get the cached jobs datas.
  • Help you easily manage your jobs into asynchronous way like:
    • reducing the time like the long time of http response in large number of requests
    • reducing the time like when interating with DataBase to query SQL
    • reducing ....

Getting Started

Code

Installation

  go get github.com/Xunzhuo/async

Built with

Concepts

Async supports two Running Mode:

  • The Standalone Job mode In this mode, each job has an unique JobID, you can create one job for one JobID
  • The Master/Slave Job mode In this mode, the job ID can be called as master job ID, the master job ID is unique as well one master job ID can contains a few slave jobs with subID, you can create one master job with many slave jobs

Async takes JobID as the key to create/find/update/delete Job

JobID in Async has two kinds:

  • jobID:
    • the unique job id in standalone job mode
    • the master job id in master/slave job mode
  • subID: the slave id in master/slave job mode

Quick Start

async.Q().
	SetMaxWaitQueueLength(100).
	SetMaxWorkQueueLength(100).
	Start().AddJobAndRun(async.NewJob(longTimeJob))

Demo

Roadmap

See the open issues for a full list of proposed features (and known issues).

Contributors

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

Contact

Project Link: https://github.com/Xunzhuo/async

Acknowledgments

About

Go 异步任务库 ⚡️ Go Async Task Library with SuperPower ⚡️

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages