scuttlebutt-golang

module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2020 License: MIT

README

Scuttlebutt Golang

Build Status Software License Coverage Status Go Report Card GolangCI GoDoc

尝试解决两个一致性问题

  1. 最终一致性问题中的 “最终结果同步”,用一个分布式 "HashMap" 解决
  2. “过程完全回放” 问题,用一个分布式 "Queue" 解决

Usage

a := model.NewSyncModel(sb.WithId("A"))
b := model.NewSyncModel(sb.WithId("B"))

sa := a.CreateStream(duplex.WithName("a->b"))
sb := b.CreateStream(duplex.WithName("b->a"))

a.Set("foo", "changed by A")

sb.On("synced", func(data interface{}) {
    PrintKeyValue(b, "foo")
})

duplex.Link(sa, sb)

Run

make run

Directories

Path Synopsis
examples
multiplex-pull command
pull-pushable command
scuttlebutt command
socket/app command
socket/cloud command
socket/vehicle command
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL