gotask

package
v0.0.0-...-1968fcb Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(execute func() error, interrupt func(error))

Add an actor (function) to the group. Each actor must be pre-emptable by an interrupt function. That is, if interrupt is invoked, execute should return. Also, it must be safe to call interrupt even after execute has returned.

The first actor (function) to return interrupts all running actors. The error is passed to the interrupt functions, and is returned by Run.

func GetAddress

func GetAddress() string

Get the address of the socket

func GetGo2PHPAddress

func GetGo2PHPAddress() string

GetGo2PHPAddress retrieves the go2php server socket address

func Register

func Register(receiver interface{}) error

Register a net/rpc compatible service

func Run

func Run() error

Run the sidecar, receive any fatal errors.

func SetAddress

func SetAddress(addr string)

Set the address of socket

func SetGo2PHPAddress

func SetGo2PHPAddress(address string)

SetGo2PHPAddress sets the go2php server socket address

Types

type Class

type Class struct {
	Name      string
	Functions []Function
}

type Client

type Client struct {
	*rpc.Client
}

Client represents a client for go2php IPC.

func NewAutoClient

func NewAutoClient() (c *Client, err error)

NewAutoClient creates a client connected to predefined connection pool.

func NewClient

func NewClient(conn net.Conn) *Client

NewClient returns a new Client using the connection provided.

type Function

type Function struct {
	Name           string
	Raw            bool
	ParamModifier  string
	ResultModifier string
}

type Handler

type Handler func(cmd interface{}, result *interface{}) error

type Middleware

type Middleware func(next Handler) Handler

func Chain

func Chain(outer Middleware, others ...Middleware) Middleware

func PanicRecover

func PanicRecover() Middleware

type Pool

type Pool struct {
	pool.Pool
}

func NewAutoPool

func NewAutoPool() (*Pool, error)

NewAutoPool creates a connection pool using pre-defined addresses

func NewPool

func NewPool(addresses []string) (*Pool, error)

NewPool creates a connection pool

Jump to

Keyboard shortcuts

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