model

package
v0.0.0-...-58360b6 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CasRegisterModel

func CasRegisterModel() core.Model

CasRegisterModel returns a cas register model

func CasRegisterParser

func CasRegisterParser() history.RecordParser

CasRegisterParser parses CasRegister history.

func RegisterModel

func RegisterModel() core.Model

RegisterModel returns a read/write register model

func RegisterParser

func RegisterParser() history.RecordParser

RegisterParser parses Register history.

Types

type CasOp

type CasOp int

CasOp is an operation.

const (
	CasRegisterRead CasOp = iota
	CasRegisterWrite
	CasRegisterCAS
)

cas operation

type CasRegisterRequest

type CasRegisterRequest struct {
	Op   CasOp
	Arg1 int // used for write, or for CAS from argument
	Arg2 int // used for CAS to argument
}

CasRegisterRequest is the request that is issued to a cas register.

type CasRegisterResponse

type CasRegisterResponse struct {
	Ok      bool // used for CAS
	Exists  bool // used for read
	Value   int  // used for read
	Unknown bool // used when operation times out
}

CasRegisterResponse is the response returned by a cas register.

func (CasRegisterResponse) IsUnknown

func (r CasRegisterResponse) IsUnknown() bool

IsUnknown implements UnknownResponse interface

type Op

type Op bool

Op is an operation.

const (
	// RegisterRead a register
	RegisterRead Op = false
	// RegisterWrite a register
	RegisterWrite Op = true
)

type RegisterRequest

type RegisterRequest struct {
	Op    Op
	Value int
}

RegisterRequest is the request that is issued to a register.

type RegisterResponse

type RegisterResponse struct {
	Unknown bool
	Value   int
}

RegisterResponse is the response returned by a register.

func (RegisterResponse) IsUnknown

func (r RegisterResponse) IsUnknown() bool

IsUnknown implements UnknownResponse interface

Jump to

Keyboard shortcuts

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