nostore

command
v0.0.0-...-5a18981 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2016 License: MIT Imports: 5 Imported by: 0

README

This example demonstrates what is needed to write your own event store for futurama.

Interfaces

Definition of interfaces can be found in interfaces.go. To support other backends (redis, mongodb, ..etc), you need to:

  • Implement StoreInterface and ConsumerInterface
  • Create queue with futurama.CreateCustomQueue
  • Provide store and consumer instances to Populate method
noConsumer := &NoConsumer{make(chan []*futurama.Event, 1024)}
noStore    := &NoStore{noConsumer.C}
q, err := futurama.CreateCustomQueue(config, triggers).Populate(noStore, noConsumer)
if err != nil {
   ...
}

q.start()

...

The example

nostore has minimum implementation of StoreInterface and ConsumerInterface, it just bypass the events to channels, everything is kept in memory

Build & run

$ go get
$ go build
$ ./nostore

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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