Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zhongl/omega

A showcase of domain design
https://github.com/zhongl/omega

Last synced: 3 days ago
JSON representation

A showcase of domain design

Awesome Lists containing this project

README

        

## Domain Object

### Definition View

```yaml
hourly:
echo: collect data by hour
only:
cron: 0 * * * * *

daily:
echo: filter
only:
task:
hourly: 24
cron: 0 0 * * *
```

```plantuml
interface Task {
name: String
description: String
command: C
precondition: P
}

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

interface DryRun {
execute(task: Task): Execution
}

interface Execution {
state: State
task: Task
journals: List
cancel(force: Boolean): void
}

interface Journal {
timestamp: long
message: String
}

```

## Dry run a task

```plantuml
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

```plantuml
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

```plantuml
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

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

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