client

package
v0.0.0-...-15b4445 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Package client provides helper methods and types for communicating with the GAPIR service.

Index

Constants

View Source
const (
	// LaunchArgsKey is the bind device property key used to control the command
	// line arguments when launching GAPIR. The property must be of type []string.
	LaunchArgsKey tyLaunchArgsKey = "gapir-launch-args"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles connections to GAPIR instances on devices. A single Client can handle multiple connections.

func New

func New(ctx context.Context) *Client

New returns a newly construct Client.

func (*Client) BeginReplay

func (client *Client) BeginReplay(ctx context.Context, conn *ConnectionKey, payload string, dependent string) error

func (*Client) Connect

func (client *Client) Connect(ctx context.Context, device bind.Device, abi *device.ABI) (*ConnectionKey, error)

Connect opens a connection to the replay device.

func (*Client) PrewarmReplay

func (client *Client) PrewarmReplay(ctx context.Context, conn *ConnectionKey, payload string, cleanup string) error

func (*Client) SetReplayExecutor

func (client *Client) SetReplayExecutor(ctx context.Context, conn *ConnectionKey, executor ReplayExecutor) (func(), error)

type ConnectionKey

type ConnectionKey deviceArch

ConnectionKey is used by manager to obtain a connection

type ReplayExecutor

type ReplayExecutor interface {
	// HandlePostData handles the given post data message.
	HandlePostData(context.Context, *gapir.PostData) error
	// HandleNotification handles the given notification message.
	HandleNotification(context.Context, *gapir.Notification) error
	// HandleFinished is notified when the given replay is finished.
	HandleFinished(context.Context, error) error

	// HandleFenceReadyRequest handles when the replayer is waiting for the server
	// to execute the registered FenceReadyRequestCallback for the provided fence ID
	HandleFenceReadyRequest(context.Context, *gapir.FenceReadyRequest) error
}

ReplayExecutor handles just the bits related to a specific replay.

Jump to

Keyboard shortcuts

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