sync

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2015 License: MIT, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MutexWrap

func MutexWrap(d ds.Datastore) ds.ThreadSafeDatastore

MutexWrap constructs a datastore with a coarse lock around the entire datastore, for every single operation

Types

type MutexDatastore

type MutexDatastore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MutexDatastore contains a child datastire and a mutex. used for coarse sync

func (*MutexDatastore) Batch added in v0.3.6

func (d *MutexDatastore) Batch() (ds.Batch, error)

func (*MutexDatastore) Children

func (d *MutexDatastore) Children() []ds.Datastore

Children implements Shim

func (*MutexDatastore) Delete

func (d *MutexDatastore) Delete(key ds.Key) (err error)

Delete implements Datastore.Delete

func (*MutexDatastore) Get

func (d *MutexDatastore) Get(key ds.Key) (value interface{}, err error)

Get implements Datastore.Get

func (*MutexDatastore) Has

func (d *MutexDatastore) Has(key ds.Key) (exists bool, err error)

Has implements Datastore.Has

func (*MutexDatastore) IsThreadSafe

func (d *MutexDatastore) IsThreadSafe()

IsThreadSafe implements ThreadSafeDatastore

func (*MutexDatastore) Put

func (d *MutexDatastore) Put(key ds.Key, value interface{}) (err error)

Put implements Datastore.Put

func (*MutexDatastore) Query

func (d *MutexDatastore) Query(q dsq.Query) (dsq.Results, error)

KeyList implements Datastore.KeyList

Jump to

Keyboard shortcuts

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