inproc

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package inproc runs job handlers in the worker process.

This is Dispatch's original behaviour and remains the default. It provides no isolation: the handler shares the worker's memory, credentials, file descriptors, and network. That is the right trade for handlers that do not touch untrusted bytes, where launching a process per job would be pure overhead, and the wrong one for anything parsing a customer upload with a memory-unsafe library.

Index

Constants

View Source
const Name = "inprocess"

Name is the identifier this executor registers under.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

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

Executor runs handlers in the worker process.

func New

func New(r *job.Registry) *Executor

New creates an in-process executor backed by a handler registry.

func (*Executor) Close

func (e *Executor) Close() error

Close is a no-op. The executor owns no resources of its own.

func (*Executor) Level

func (e *Executor) Level() exec.Level

Level reports that this executor provides no isolation.

func (*Executor) Name

func (e *Executor) Name() string

Name identifies the executor.

func (*Executor) Reclaim

func (e *Executor) Reclaim(context.Context, id.WorkerID) error

Reclaim is a no-op. An in-process handler cannot outlive the worker that called it, so there is never anything to reclaim.

func (*Executor) Run

func (e *Executor) Run(ctx context.Context, req *exec.Request) (*exec.Result, error)

Run looks the handler up by name and calls it.

Jump to

Keyboard shortcuts

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