mdp

package
v0.0.0-...-0464a3b Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2015 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

This file is part of fingerpoken Copyright (C) 2015 Jordan Sissel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This file is part of fingerpoken Copyright (C) 2015 Jordan Sissel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This file is part of fingerpoken Copyright (C) 2015 Jordan Sissel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This file is part of fingerpoken Copyright (C) 2015 Jordan Sissel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This file is part of fingerpoken Copyright (C) 2015 Jordan Sissel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This file is part of fingerpoken Copyright (C) 2015 Jordan Sissel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This file is part of fingerpoken Copyright (C) 2015 Jordan Sissel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

This file is part of fingerpoken Copyright (C) 2015 Jordan Sissel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	HeartbeatInterval   time.Duration
	MaxMissedHeartbeats int64

	HeartbeatCallback func(*workerEntry)

	CurveCertificate *czmq.Cert
	// contains filtered or unexported fields
}

func NewBroker

func NewBroker(endpoint string) (b *Broker, err error)

func (*Broker) Bind

func (b *Broker) Bind(endpoint string) (int, error)

func (*Broker) Run

func (b *Broker) Run()

func (*Broker) Unbind

func (b *Broker) Unbind(endpoint string) error

type Client

type Client struct {
	RetryInterval time.Duration
	RetryCount    int64
	CurveInfo
	// contains filtered or unexported fields
}

func NewClient

func NewClient(broker string) (c *Client)

func (*Client) Destroy

func (c *Client) Destroy()

func (*Client) Recv

func (c *Client) Recv() (response [][]byte, err error)

func (*Client) Send

func (c *Client) Send(service string, body [][]byte) (err error)

func (*Client) SendRecv

func (c *Client) SendRecv(service string, body [][]byte) (response [][]byte, err error)

func (*Client) WaitForReply

func (c *Client) WaitForReply() error

type CurveInfo

type CurveInfo struct {
	CurveServerPublicKey string
	CurveCertificate     *czmq.Cert
}

type JSONRPCWorker

type JSONRPCWorker struct {
	CurveServerPublicKey string
	CurveCertificate     *czmq.Cert
	// contains filtered or unexported fields
}

func NewJSONRPCWorker

func NewJSONRPCWorker(broker_endpoint, service string) (j *JSONRPCWorker)

func (*JSONRPCWorker) Disconnect

func (j *JSONRPCWorker) Disconnect()

func (*JSONRPCWorker) Heartbeat

func (j *JSONRPCWorker) Heartbeat()

func (*JSONRPCWorker) Register

func (j *JSONRPCWorker) Register(handler interface{}) error

func (*JSONRPCWorker) Request

func (j *JSONRPCWorker) Request(request [][]byte) (response [][]byte, err error)

the mdp.Worker interface

func (*JSONRPCWorker) Run

func (j *JSONRPCWorker) Run()

type RequestHandler

type RequestHandler interface {
	Request([][]byte) ([][]byte, error)
	Heartbeat()
	Disconnect()
}

type Worker

type Worker struct {
	CurveInfo

	HeartbeatInterval   time.Duration
	MaxMissedHeartbeats int64
	// contains filtered or unexported fields
}

TODO(sissel): turn this into an interface?

func NewWorker

func NewWorker(broker string, service string) (w *Worker)

func (*Worker) Reset

func (w *Worker) Reset()

func (*Worker) Run

func (w *Worker) Run(requestHandler RequestHandler) error

Jump to

Keyboard shortcuts

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