asynchronousIO

package module
v0.0.0-...-384d90b Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: MIT Imports: 1 Imported by: 2

README

asynchronousIO

a package load information asynchronously

Documentation

Index

Constants

View Source
const UnknownType uint16 = 0xffff

Variables

This section is empty.

Functions

This section is empty.

Types

type AsynchronousIOError

type AsynchronousIOError struct {
	E error
}

func (AsynchronousIOError) Error

func (e AsynchronousIOError) Error() string

func (AsynchronousIOError) GetKey

func (AsynchronousIOError) GetKey() Key

type AsynchronousIOMachine

type AsynchronousIOMachine interface {
	Load(key Key, source uint16) func() (Bean, error)
	Save(bean Bean, source uint16)
	// must call the return function
	Delete(key Key, source uint16) func() error
	SaveAndCallBackWhenFinish(bean Bean, source uint16) func() error
}

type Bean

type Bean interface {
	GetKey() Key
}

type CmdTable

type CmdTable interface {
	Save(k int64, bean Bean, notify bool, cs *sync.Pool) (c chan Bean, start bool)
	Load(k int64, cs *sync.Pool) (c chan Bean, bean Bean)
	Delete(k int64, cs *sync.Pool) (c chan Bean, start bool)
	Get(k int64, lastCmd uint8, lastBean Bean) (cmd uint8, bean Bean, c chan Bean, restart bool)
}

type DataSource

type DataSource interface {
	Load(key Key) (Bean, error)
	Save(bean Bean) error
	Delete(key Key) error
}

type Finish

type Finish struct{}

func (Finish) GetKey

func (Finish) GetKey() Key

type Key

type Key interface {
	UniqueId() (int64, bool)
	ToString() (string, bool)
	TypeId() int64
}

type MemorySource

type MemorySource interface {
	Alloc(length int) interface{}
	Free(interface{})
}

type Start

type Start struct{}

func (Start) GetKey

func (Start) GetKey() Key

type UnknownTypeError

type UnknownTypeError struct{}

func (UnknownTypeError) Error

func (UnknownTypeError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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