notify

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package notify coalesces resource-change events into debounced notifications/resources/updated, keyed per resource URI.

Index

Constants

View Source
const DefaultDebounce = 500 * time.Millisecond

Variables

This section is empty.

Functions

This section is empty.

Types

type Publisher

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

func NewPublisher

func NewPublisher(cfg config.ResourcesConfig, logger *slog.Logger) (*Publisher, error)

func (*Publisher) Attach

func (p *Publisher) Attach(srv *mcp.Server)

Attach binds the MCP server used to send notifications. Call once, before the first Touch.

func (*Publisher) Close

func (p *Publisher) Close()

func (*Publisher) HandleSubscribe

func (p *Publisher) HandleSubscribe(_ context.Context, req *mcp.SubscribeRequest) error

func (*Publisher) HandleUnsubscribe

func (p *Publisher) HandleUnsubscribe(_ context.Context, _ *mcp.UnsubscribeRequest) error

HandleUnsubscribe is a no-op: the SDK owns subscription state and ResourceUpdated already skips unsubscribed sessions.

func (*Publisher) Touch

func (p *Publisher) Touch(uri string)

Touch records that uri changed.

Jump to

Keyboard shortcuts

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