PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/g17khqpukees4237dtn3astzapmp462vjhsz6st4/message

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
message
Namespace
g17khqpukees4237dtn3astzapmp462vjhsz6st4
Files
4 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/g17khqpukees4237dtn3astzapmp462vjhsz6st4/message
gno
0.9

Files (4)

  • README.mdmarkdown
  • gnomod.tomltoml
  • broker.gnogno
  • message.gnogno
message.gnogno
1// Package message provides a simple message broker implementation.2package message34// TopicAll defines a topic for all types of message.5// This topic can be used to subscribe to message for all topics.6const TopicAll Topic = "*"78type (9	// Topic defines a type for message topics.10	Topic string1112	// Callback defines a type for message callbacks.13	Callback func(Message)1415	// Message defines a type for published messages.16	Message struct {17		// Topic is the message topic.18		Topic Topic1920		// Data contains optional message data.21		Data any22	}2324	// Publisher defines an interface for message publishers.25	Publisher interface {26		// Publish publishes a message for a topic.27		Publish(_ Topic, data any) error28	}2930	// Subscriber defines an interface for message subscribers.31	Subscriber interface {32		// Subscribe subscribes to messages published for a topic.33		// It returns the callback ID within the topic.34		Subscribe(Topic, Callback) (id int, _ error)3536		// Unsubscribe unsubscribes a callback from a message topic.37		// ID is the callback ID within the topic, returned on subscription.38		Unsubscribe(_ Topic, id int) (unsubscribed bool, _ error)39	}40)41

Functions

not supported for pure packages by the node (vm/qfuncs)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.