Documentation ¶
Index ¶
- type IOCB
- func (i *IOCB) Abort(err error) error
- func (i *IOCB) AddCallback(fn func())
- func (i *IOCB) Close() error
- func (i *IOCB) Complete(apdu PDU) error
- func (i *IOCB) GetDestination() *Address
- func (i *IOCB) GetIOError() error
- func (i *IOCB) GetIOResponse() PDU
- func (d *IOCB) Serialize() ([]byte, error)
- func (d *IOCB) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (i *IOCB) SetTimeout(delay time.Duration)
- func (d *IOCB) String() string
- func (i *IOCB) Trigger()
- func (i *IOCB) Wait()
- type IOCBContract
- type IOCBState
- type IOController
- func (i *IOController) Abort(err error) error
- func (i *IOController) AbortIO(iocb IOCBContract, err error) error
- func (i *IOController) ActiveIO(iocb IOCBContract) error
- func (i *IOController) CompleteIO(iocb IOCBContract, apdu PDU) error
- func (i *IOController) ProcessIO(IOCBContract) error
- func (i *IOController) RequestIO(iocb IOCBContract) error
- func (d *IOController) Serialize() ([]byte, error)
- func (d *IOController) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *IOController) String() string
- type IOControllerRequirements
- type IOQController
- func (i *IOQController) Abort(err error) error
- func (i *IOQController) AbortIO(iocb IOCBContract, err error) error
- func (i *IOQController) ActiveIO(iocb IOCBContract) error
- func (i *IOQController) Close() error
- func (i *IOQController) CompleteIO(iocb IOCBContract, msg PDU) error
- func (i *IOQController) ProcessIO(IOCBContract) error
- func (i *IOQController) RequestIO(iocb IOCBContract) error
- func (d *IOQController) Serialize() ([]byte, error)
- func (d *IOQController) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *IOQController) String() string
- type IOQControllerRequirements
- type IOQControllerStates
- type IOQueue
- func (i *IOQueue) Abort(err error)
- func (i *IOQueue) Close() error
- func (i *IOQueue) Get(block bool, delay *time.Duration) (IOCBContract, error)
- func (i *IOQueue) Put(iocb IOCBContract) error
- func (i *IOQueue) Remove(iocb IOCBContract) error
- func (d *IOQueue) Serialize() ([]byte, error)
- func (d *IOQueue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *IOQueue) String() string
- type SieveQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IOCB ¶
type IOCB struct {
// contains filtered or unexported fields
}
func (*IOCB) AddCallback ¶
func (i *IOCB) AddCallback(fn func())
AddCallback Pass a function to be called when IO is complete.
func (*IOCB) Complete ¶
Complete Called to complete a transaction, usually when ProcessIO has shipped the IOCB off to some other thread or
function.
func (*IOCB) GetDestination ¶
func (i *IOCB) GetDestination() *Address
func (*IOCB) GetIOError ¶
func (*IOCB) GetIOResponse ¶
func (i *IOCB) GetIOResponse() PDU
func (*IOCB) SerializeWithWriteBuffer ¶
func (*IOCB) SetTimeout ¶
SetTimeout Called to set a transaction timer.
type IOCBContract ¶
type IOCBContract interface { fmt.Stringer Trigger() GetDestination() *Address Abort(err error) error // contains filtered or unexported methods }
IOCBContract provides a set of functions which can be overwritten by a sub struct
type IOController ¶
type IOController struct {
// contains filtered or unexported fields
}
func NewIOController ¶
func NewIOController(localLog zerolog.Logger, name string, requirements IOControllerRequirements, options ...Option) (*IOController, error)
func (*IOController) Abort ¶
func (i *IOController) Abort(err error) error
Abort all requests, no default implementation.
func (*IOController) AbortIO ¶
func (i *IOController) AbortIO(iocb IOCBContract, err error) error
AbortIO Called by a handler or a client to abort a transaction
func (*IOController) ActiveIO ¶
func (i *IOController) ActiveIO(iocb IOCBContract) error
ActiveIO Called by a handler to notify the controller that a request is being processed
func (*IOController) CompleteIO ¶
func (i *IOController) CompleteIO(iocb IOCBContract, apdu PDU) error
CompleteIO Called by a handler to return data to the client
func (*IOController) ProcessIO ¶
func (i *IOController) ProcessIO(IOCBContract) error
ProcessIO Figure out how to respond to this request. This must be provided by the derived class.
func (*IOController) RequestIO ¶
func (i *IOController) RequestIO(iocb IOCBContract) error
RequestIO Called by a client to start processing a request.
func (*IOController) Serialize ¶
func (d *IOController) Serialize() ([]byte, error)
func (*IOController) SerializeWithWriteBuffer ¶
func (d *IOController) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*IOController) String ¶
func (d *IOController) String() string
type IOControllerRequirements ¶
type IOControllerRequirements interface { Abort(err error) error ProcessIO(iocb IOCBContract) error CompleteIO(iocb IOCBContract, pdu PDU) error AbortIO(iocb IOCBContract, err error) error }
type IOQController ¶
type IOQController struct { *IOController `stringer:"true"` ActiveIOCB IOCBContract `stringer:"true"` IoQueue *IOQueue `stringer:"true"` // contains filtered or unexported fields }
func NewIOQController ¶
func NewIOQController(localLog zerolog.Logger, name string, requirements IOQControllerRequirements) (*IOQController, error)
func (*IOQController) Abort ¶
func (i *IOQController) Abort(err error) error
Abort all pending requests
func (*IOQController) AbortIO ¶
func (i *IOQController) AbortIO(iocb IOCBContract, err error) error
AbortIO Called by a handler or a client to abort a transaction
func (*IOQController) ActiveIO ¶
func (i *IOQController) ActiveIO(iocb IOCBContract) error
ActiveIO Called by a handler to notify the controller that a request is being processed
func (*IOQController) Close ¶
func (i *IOQController) Close() error
func (*IOQController) CompleteIO ¶
func (i *IOQController) CompleteIO(iocb IOCBContract, msg PDU) error
CompleteIO Called by a handler to return data to the client
func (*IOQController) ProcessIO ¶
func (i *IOQController) ProcessIO(IOCBContract) error
ProcessIO Figure out how to respond to this request. This must be provided by the derived class
func (*IOQController) RequestIO ¶
func (i *IOQController) RequestIO(iocb IOCBContract) error
RequestIO Called by a client to start processing a request
func (*IOQController) Serialize ¶
func (d *IOQController) Serialize() ([]byte, error)
func (*IOQController) SerializeWithWriteBuffer ¶
func (d *IOQController) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*IOQController) String ¶
func (d *IOQController) String() string
type IOQControllerRequirements ¶
type IOQControllerRequirements interface { IOControllerRequirements ProcessIO(iocb IOCBContract) error }
type IOQControllerStates ¶
type IOQControllerStates int
const ( IOQControllerStates_CTRL_IDLE IOQControllerStates = iota IOQControllerStates_CTRL_ACTIVE IOQControllerStates_CTRL_WAITING )
func (IOQControllerStates) String ¶
func (i IOQControllerStates) String() string
type IOQueue ¶
type IOQueue struct { Queue PriorityQueue[int, IOCBContract] // contains filtered or unexported fields }
func (*IOQueue) Put ¶
func (i *IOQueue) Put(iocb IOCBContract) error
Put an IOCB to a queue. This is usually called by the function that filters requests and passes them out to the
correct processing thread.
func (*IOQueue) Remove ¶
func (i *IOQueue) Remove(iocb IOCBContract) error
Remove a control block from the queue, called if the request
is canceled/aborted
func (*IOQueue) SerializeWithWriteBuffer ¶
type SieveQueue ¶
type SieveQueue struct { *IOQController // contains filtered or unexported fields }
func NewSieveQueue ¶
func NewSieveQueue(localLog zerolog.Logger, fn func(apdu PDU), address *Address) (*SieveQueue, error)
func (*SieveQueue) ProcessIO ¶
func (s *SieveQueue) ProcessIO(iocb IOCBContract) error
func (*SieveQueue) Serialize ¶
func (d *SieveQueue) Serialize() ([]byte, error)
func (*SieveQueue) SerializeWithWriteBuffer ¶
func (d *SieveQueue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*SieveQueue) String ¶
func (d *SieveQueue) String() string