Skip to content

17twenty/baxter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Baxter

Motivation

Building reusable components for web platforms. I hated the rest.

How it works

You instantiate your baxter instance and

// Setup baxter. Choose the backend that makes most
// sense for your use case.
baxter.Init(baxter.InMemory(10)) 

// Subscribe to an event
baxter.Subscribe("event.test", func(event string, meta json.RawMessage) {
    log.Println("Caught event", string(meta))
})

// Start baxters message pump
baxter.Start()

// Publish an event to baxter
baxter.Publish("event.test", []byte("hello"))

// Shutdown baxters message pump
baxter.Stop()

Getting Started

go build ./cmd/baxter-cli/ && ./baxter-cli 

Todo

  • Move to taking an any and doing the marshal/unmarshal into JSON automagically
  • Threadsafe (use the tools)
  • Add the missing magic to safely stop the message pump based on this article.
  • Provide an auth example showing how anyone can incorporate baxter for loosely coupled products.
  • Provide another backend

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages