mproc

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Receiver

type Receiver[TIn any, TOut any] interface {
	Receive(infile, outfile, enckey string) error
	ReceiveWithContext(ctx context.Context, infile, outfile, enckey string) error
}

func NewReceiver

func NewReceiver[TIn any, TOut any](handler ReceiverHandler[TIn, TOut]) Receiver[TIn, TOut]

创建并返回一个多进程指令接收器。

入参:

  • handler: 多进程指令处理函数。

出参:

  • 多进程指令接收器。

type ReceiverHandler

type ReceiverHandler[TIn any, TOut any] func(ctx context.Context, params *TIn) (*TOut, error)

type Sender

type Sender[TIn any, TOut any] interface {
	Send(params *TIn) (*TOut, error)
	SendWithContext(ctx context.Context, params *TIn) (*TOut, error)
}

func NewSender

func NewSender[TIn any, TOut any](command string, logger *slog.Logger) Sender[TIn, TOut]

创建并返回一个多进程指令发送器。

入参:

  • command: 多进程指令命令。需要先注册为 `intercmd [command]` 命令行。
  • logger: 日志记录器,将重定向多进程的标准输出流和标准错误流到该日志记录器中。

出参:

  • 多进程指令发送器。

Jump to

Keyboard shortcuts

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