fieldalignment of all structs to save memory

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-04-27 08:32:47 +03:00
parent ee11f39a2f
commit 86626c5922
78 changed files with 343 additions and 410 deletions

View File

@@ -44,10 +44,10 @@ func TestDag(t *testing.T) {
var steps [][]string
fn := func(n dag.Vertex, idx int) error {
if idx == 0 {
steps = make([][]string, 1, 1)
steps = make([][]string, 1)
steps[0] = make([]string, 0, 1)
} else if idx >= len(steps) {
tsteps := make([][]string, idx+1, idx+1)
tsteps := make([][]string, idx+1)
copy(tsteps, steps)
steps = tsteps
steps[idx] = make([]string, 0, 1)

View File

@@ -1,7 +1,17 @@
// Package flow is an interface used for saga pattern messaging
// Package flow is an interface used for saga pattern microservice workflow
package flow
type Step interface {
// Endpoint returns service_name.service_method
// Endpoint returns rpc endpoint service_name.service_method or broker topic
Endpoint() string
}
type Workflow interface {
Steps() [][]Step
Stop() error
}
type Flow interface {
Start(Workflow) error
Stop(Workflow)
}