Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/zhongl/omega
- Owner: zhongl
- Created: 2019-08-05T08:29:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-14T02:36:58.000Z (about 4 years ago)
- Last Synced: 2024-11-05T10:57:31.360Z (about 2 months ago)
- Language: Java
- Size: 8.79 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 Ecreate 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 MU -> S: plan(task)
create E
S -> E: newcreate 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 UE -> 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 EU -> S: latest(task)
U -> E: journals
```