atomic

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteAll

func WriteAll(baseBatch database.Batch, batches ...database.Batch) error

WriteAll assumes all batches have the same underlying database. Batches should not be modified after being passed to this function.

Types

type BlockchainSharedMemory

type BlockchainSharedMemory struct {
	// contains filtered or unexported fields
}

BlockchainSharedMemory provides the API for a blockchain to interact with shared memory of another blockchain

func (*BlockchainSharedMemory) GetDatabase

func (bsm *BlockchainSharedMemory) GetDatabase(id ids.ID) database.Database

GetDatabase returns and locks the provided DB

func (*BlockchainSharedMemory) ReleaseDatabase

func (bsm *BlockchainSharedMemory) ReleaseDatabase(id ids.ID)

ReleaseDatabase unlocks the provided DB

type SharedMemory

type SharedMemory struct {
	// contains filtered or unexported fields
}

SharedMemory is the interface for shared memory inside a subnet

func (*SharedMemory) GetDatabase

func (sm *SharedMemory) GetDatabase(id ids.ID) database.Database

GetDatabase returns and locks the provided DB

func (*SharedMemory) Initialize

func (sm *SharedMemory) Initialize(log logging.Logger, db database.Database)

Initialize the SharedMemory

func (*SharedMemory) NewBlockchainSharedMemory

func (sm *SharedMemory) NewBlockchainSharedMemory(id ids.ID) *BlockchainSharedMemory

NewBlockchainSharedMemory returns a new BlockchainSharedMemory

func (*SharedMemory) ReleaseDatabase

func (sm *SharedMemory) ReleaseDatabase(id ids.ID)

ReleaseDatabase unlocks the provided DB

Jump to

Keyboard shortcuts

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