gotask

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 20 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 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