$ brew install gradle (optionnal)
$ brew install groovy (optionnal)
$ brew install vert.x
- Service periodically announces itself to "/city"
{
"action": "hello",
"team": "choose your team name and stick to it",
"from": "unique instance id",
"type": "factory",
"version": "version"
}
- Factory emits Request to "/city/farm"
- Store emits Request to "/city/factory"
{
"action": "request",
"from": "factory id",
"quantity": 10,
"cost" : 1000 // for stores
}
- Farm sends Response with timeout to "/city/factory/id"
- Factory sends Response with timeout to "/city/store/id"
{
"action": "response",
"from": "farm id",
"quantity": 10,
"cost": 100
}
- Factory replies Acquittement to the farm
- Store replies Acquittement to the factory
{
"action": "acquittement",
"from": "factory id",
"quantity": 9
}
- Farm sends Purchase bill to "/city/bank"
- Store sends Sale bill to the "/city/bank"
{
"action": "purchase|sale",
"from": "farm id",
"charge": "factory id",
"quantity": 9,
"cost": 100
}
- Bank sends Purchase info to "/city/factory/id"
- Bank sends Sale info to "/city/factory/id"
{
"action": "purchase|sale|cost",
"from": "bank",
"quantity": 9,
"cost": 100
}
- Bank sends status to "/city/factory/id"
{
"action": "status",
"from": "bank",
"purchases": 100,
"sales": 100,
"costs": 100,
"stocks": 100
}