Giter Site home page Giter Site logo

feat/add task queue about quics-client HOT 3 CLOSED

vivi108 avatar vivi108 commented on July 28, 2024
feat/add task queue

from quics-client.

Comments (3)

vivi108 avatar vivi108 commented on July 28, 2024
type JType string

const (
	ConnectServer    JType = "CONNECT_SERVER"
	ConnectRoot      JType = "CONNECT_ROOT"
	DisconnectServer JType = "DISCONNECT_SERVER"
	Rescan           JType = "RESCAN"
	ShowStatus       JType = "SHOW_STATUS"
	ChooseOne        JType = "CHOOSE_ONE"
)

type JStatus string

const (
	Ready   JStatus = "READY"
	Working JStatus = "WORKING"
	Done    JStatus = "DONE"
)

type JPriority string

const (
	High   JPriority = "HIGH"
	Medium JPriority = "MEDIUM"
	Low    JPriority = "LOW"
)

type Job struct {
	Type     JType
	Status   JStatus
	Priority JPriority
	JobID    string
}

/* TODO
0. When start the Program -> Create JobQueue (JobQueue is a list of Job)

  1. When Transcation gonna be started -> Create Job
  2. When Job is created -> Add Job to JobQueue
  3. When Job is added to JobQueue -> JobQueue is sorted by Priority
  4. When Transcation is started -> Change Job Status to Working
  5. When Transaction is done -> Change Job Status to Done
  6. When Job Status is Done -> Remove Job from JobQueue
    */

/* DISCUSS

  1. How to make JobQueue? Queue or Stack
  2. How to sort JobQueue? Priority
  3. Should Job queue is in memory or in disk(badger)?
  4. How to make JobID? UUID
    */

from quics-client.

vivi108 avatar vivi108 commented on July 28, 2024

/* DISCUSS

How to make JobQueue? Linked List

type JobQueue struct {
	mut sync.Mutex
	low *Job
	mudium *Job
	high *job
	urgent *Job
	
}

How to sort JobQueue? Do not sort
Should Job queue is in memory or in disk(badger)? in-memory
How to make JobID? UUID
*/

from quics-client.

vivi108 avatar vivi108 commented on July 28, 2024

Delayed

from quics-client.

Related Issues (13)

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.