appcycle

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package appcycle defines interfaces for managing application processes.

Index

Constants

This section is empty.

Variables

View Source
var AppCycleDesc rpc.InterfaceDesc = descAppCycle

AppCycleDesc describes the AppCycle interface.

Functions

This section is empty.

Types

type AppCycleClientMethods

type AppCycleClientMethods interface {
	// Stop initiates shutdown of the server.  It streams back periodic
	// updates to give the client an idea of how the shutdown is
	// progressing.
	Stop(*context.T, ...rpc.CallOpt) (AppCycleStopClientCall, error)
	// ForceStop tells the server to shut down right away.  It can be issued
	// while a Stop is outstanding if for example the client does not want
	// to wait any longer.
	ForceStop(*context.T, ...rpc.CallOpt) error
}

AppCycleClientMethods is the client interface containing AppCycle methods.

AppCycle interfaces with the process running a vanadium runtime.

type AppCycleClientStub

type AppCycleClientStub interface {
	AppCycleClientMethods
	rpc.UniversalServiceMethods
}

AppCycleClientStub adds universal methods to AppCycleClientMethods.

func AppCycleClient

func AppCycleClient(name string) AppCycleClientStub

AppCycleClient returns a client stub for AppCycle.

type AppCycleServerMethods

type AppCycleServerMethods interface {
	// Stop initiates shutdown of the server.  It streams back periodic
	// updates to give the client an idea of how the shutdown is
	// progressing.
	Stop(*context.T, AppCycleStopServerCall) error
	// ForceStop tells the server to shut down right away.  It can be issued
	// while a Stop is outstanding if for example the client does not want
	// to wait any longer.
	ForceStop(*context.T, rpc.ServerCall) error
}

AppCycleServerMethods is the interface a server writer implements for AppCycle.

AppCycle interfaces with the process running a vanadium runtime.

type AppCycleServerStub

type AppCycleServerStub interface {
	AppCycleServerStubMethods
	// DescribeInterfaces the AppCycle interfaces.
	Describe__() []rpc.InterfaceDesc
}

AppCycleServerStub adds universal methods to AppCycleServerStubMethods.

func AppCycleServer

func AppCycleServer(impl AppCycleServerMethods) AppCycleServerStub

AppCycleServer returns a server stub for AppCycle. It converts an implementation of AppCycleServerMethods into an object that may be used by rpc.Server.

type AppCycleServerStubMethods

type AppCycleServerStubMethods interface {
	// Stop initiates shutdown of the server.  It streams back periodic
	// updates to give the client an idea of how the shutdown is
	// progressing.
	Stop(*context.T, *AppCycleStopServerCallStub) error
	// ForceStop tells the server to shut down right away.  It can be issued
	// while a Stop is outstanding if for example the client does not want
	// to wait any longer.
	ForceStop(*context.T, rpc.ServerCall) error
}

AppCycleServerStubMethods is the server interface containing AppCycle methods, as expected by rpc.Server. The only difference between this interface and AppCycleServerMethods is the streaming methods.

type AppCycleStopClientCall

type AppCycleStopClientCall interface {
	AppCycleStopClientStream
	// Finish blocks until the server is done, and returns the positional return
	// values for call.
	//
	// Finish returns immediately if the call has been canceled; depending on the
	// timing the output could either be an error signaling cancelation, or the
	// valid positional return values from the server.
	//
	// Calling Finish is mandatory for releasing stream resources, unless the call
	// has been canceled or any of the other methods return an error.  Finish should
	// be called at most once.
	Finish() error
}

AppCycleStopClientCall represents the call returned from AppCycle.Stop.

type AppCycleStopClientStream

type AppCycleStopClientStream interface {
	// RecvStream returns the receiver side of the AppCycle.Stop client stream.
	RecvStream() interface {
		// Advance stages an item so that it may be retrieved via Value.  Returns
		// true iff there is an item to retrieve.  Advance must be called before
		// Value is called.  May block if an item is not available.
		Advance() bool
		// Value returns the item that was staged by Advance.  May panic if Advance
		// returned false or was not called.  Never blocks.
		Value() Task
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
}

AppCycleStopClientStream is the client stream for AppCycle.Stop.

type AppCycleStopServerCall

type AppCycleStopServerCall interface {
	rpc.ServerCall
	AppCycleStopServerStream
}

AppCycleStopServerCall represents the context passed to AppCycle.Stop.

type AppCycleStopServerCallStub

type AppCycleStopServerCallStub struct {
	rpc.StreamServerCall
}

AppCycleStopServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements AppCycleStopServerCall.

func (*AppCycleStopServerCallStub) Init

Init initializes AppCycleStopServerCallStub from rpc.StreamServerCall.

func (*AppCycleStopServerCallStub) SendStream

func (s *AppCycleStopServerCallStub) SendStream() interface {
	Send(item Task) error
}

SendStream returns the send side of the AppCycle.Stop server stream.

type AppCycleStopServerStream

type AppCycleStopServerStream interface {
	// SendStream returns the send side of the AppCycle.Stop server stream.
	SendStream() interface {
		// Send places the item onto the output stream.  Returns errors encountered
		// while sending.  Blocks if there is no buffer space; will unblock when
		// buffer space is available.
		Send(item Task) error
	}
}

AppCycleStopServerStream is the server stream for AppCycle.Stop.

type Task

type Task struct {
	Progress int32
	Goal     int32
}

Task is streamed by Stop to provide the client with a sense of the progress of the shutdown. The meaning of Progress and Goal are up to the developer (the server provides the framework with values for these). The recommended meanings are:

  • Progress: how far along the shutdown sequence the server is. This should be a monotonically increasing number.
  • Goal: when Progress reaches this value, the shutdown is expected to complete. This should not change during a stream, but could change if e.g. new shutdown tasks are triggered that were not forseen at the outset of the shutdown.

func (Task) VDLIsZero

func (x Task) VDLIsZero() bool

func (*Task) VDLRead

func (x *Task) VDLRead(dec vdl.Decoder) error

func (Task) VDLReflect

func (Task) VDLReflect(struct {
	Name string `vdl:"v.io/v23/services/appcycle.Task"`
})

func (Task) VDLWrite

func (x Task) VDLWrite(enc vdl.Encoder) error

Jump to

Keyboard shortcuts

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