Coder Social home page Coder Social logo

omega's Introduction

Domain Object

Definition View

hourly: 
  echo: collect data by hour
  only:
    cron: 0 * * * * *
    
daily:
  echo: filter
  only:
    task: 
      hourly: 24
    cron: 0 0 * * *
interface Task<C, P> {
    name: String
    description: String
    command: C
    precondition: P
}

interface Scheduler<C, P> {
    tasks: Collection<Task<C, P>>    
    plan(task: Task<C, P>): Optional<Task<C, P>> 
    pause(task: Task<C, P>): Optional<Task<C, P>> 
    remove(task: Task<C, P>): Optional<Task<C, P>> 
    latest(task: Task<C, P>): Execution<C, P>
    history(task: Task<C, P>): List<Execution<C, P>>
}

interface DryRun<C, P> {
    execute(task: Task<C, P>): Execution<C, P>
}

interface Execution<C, P> {
    state: State
    task: Task<C, P>
    journals: List<Journal> 
    cancel(force: Boolean): void
}

interface Journal {
    timestamp: long
    message: String
}

Dry run a task

actor User as U
participant Task as T
participant DryRun as D
participant Execution as E


create T
U -> T: define
U -> D: execute(task)

create E
D -> E: new

Plan a task

actor User as U
participant Scheduler as S
participant Execution as E
participant Timer as M

U -> S: plan(task)

create E
S -> E: new

create M
S -> M: schedule(task)
M -> E: on(timeout)

E -> E: run
E -> S: finish(execution)

Alarm a failure of execution

participant Execution as E
participant Scheduler as S
participant Alarm as A
actor User as U

E -> S: finish(failure)
S -> A: trigger(report, user)
A -> U: notify(report)

Detect the reason of alarm

actor User as U
participant Scheduler as S
participant Execution as E

U -> S: latest(task)
U -> E: journals

omega's People

Contributors

dependabot[bot] avatar zhongl avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

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.