zmq

package module
v0.0.0-...-5405120 Latest Latest
Warning

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

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

README

xk6-zmq

This is a k6 extension using the xk6 system.

❗ This is a proof of concept, isn't supported by the k6 team, and may break in the future. USE AT YOUR OWN RISK!

Build

To build a k6 binary with this extension, first ensure you have the prerequisites:

Then:

  1. Install xk6:
$ go install go.k6.io/xk6/cmd/xk6@latest
  1. Build the binary:
$ xk6 build --with github.com/dgzlopes/xk6-zmq@latest

Example

import zmq from 'k6/x/zmq';

const socket = zmq.newSocket("tcp://localhost:5555")

export default function () {
  url.Send(socket,"foo")
}

export function teardown () {
  url.closeSocket(socket)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReportError

func ReportError(err error, msg string)

ReportError is a handy function to show errors

Types

type ZMQ

type ZMQ struct{}

ZMQ is the k6 ZeroMQ extension.

func (*ZMQ) CloseSocket

func (*ZMQ) CloseSocket(requester *zmq.Socket)

CloseSocket closes the socket. If not called explicitly, the socket will be closed on garbage collection

func (*ZMQ) NewSocket

func (*ZMQ) NewSocket(addr string) *zmq.Socket

NewSocket creates a new ZeroMQ socket

func (*ZMQ) Send

func (*ZMQ) Send(requester *zmq.Socket, data string)

Send sends a message part on a socket.

Jump to

Keyboard shortcuts

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