requests

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	services.StateMachine
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(lggr logger.Logger, s *Store, clock clockwork.Clock, responseExpiryTime time.Duration) *Handler

func (*Handler) Close

func (h *Handler) Close() error

func (*Handler) SendRequest

func (h *Handler) SendRequest(ctx context.Context, r *Request)

func (*Handler) SendResponse

func (h *Handler) SendResponse(ctx context.Context, resp *Response)

func (*Handler) Start

func (h *Handler) Start(_ context.Context) error

type Request

type Request struct {
	Observations *values.List `mapstructure:"-"`
	ExpiresAt    time.Time

	// CallbackCh is a channel to send a response back to the requester
	// after the request has been processed or timed out.
	CallbackCh chan capabilities.CapabilityResponse
	StopCh     services.StopChan

	WorkflowExecutionID      string
	WorkflowID               string
	WorkflowOwner            string
	WorkflowName             string
	WorkflowDonID            uint32
	WorkflowDonConfigVersion uint32
	ReportID                 string
}

type Response

type Response struct {
	WorkflowExecutionID string
	capabilities.CapabilityResponse
}

type Store

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

func NewStore

func NewStore() *Store

func (*Store) Add

func (s *Store) Add(req *Request) error

func (*Store) FirstN

func (s *Store) FirstN(ctx context.Context, batchSize int) ([]*Request, error)

func (*Store) Get

func (s *Store) Get(requestID string) *Request

func (*Store) GetN added in v0.2.0

func (s *Store) GetN(ctx context.Context, requestIDs []string) []*Request

GetN is best-effort, doesn't return requests that are not in store

Jump to

Keyboard shortcuts

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