Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNilConfig = errors.New("cannot override nil config")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { PoolCfg *PoolConfig `yaml:"pool"` ProcessedTransactionTopic string `yaml:"processed_transaction_topic"` CancelledTransactionTopic string `yaml:"cancelled_transaction_topic"` }
Config represents the transaction subscriber configuration.
type PoolConfig ¶
type PoolConfig struct { IdleTimeout time.Duration `yaml:"idle_timeout"` MinWorkers int `yaml:"min_workers"` NumWorkers int `yaml:"num_workers"` TasksCapacity int `yaml:"tasks_capacity"` }
PoolConfig holds configuration settings for worker pool.
type TransactionSubscriber ¶
type TransactionSubscriber struct {
// contains filtered or unexported fields
}
TransactionSubscriber represents a subscriber handling transaction-related messages.
func NewTransactionSubscriber ¶
func NewTransactionSubscriber( cfg *Config, log logger.Logger, router *message.Router, sub message.Subscriber, pub message.Publisher, publisherCfg *publisher.Config, algorandCfg *algorand.Config, monitorClient monitor_client.ClientService, ) (*TransactionSubscriber, error)
NewTransactionSubscriber creates a new instance of TransactionSubscriber.
func (*TransactionSubscriber) RegisterCancelledTransactionHandler ¶
func (s *TransactionSubscriber) RegisterCancelledTransactionHandler()
RegisterCancelledTransactionHandler registers a handler for cancelled transaction messages.
func (*TransactionSubscriber) RegisterProcessedTransactionHandler ¶
func (s *TransactionSubscriber) RegisterProcessedTransactionHandler()
RegisterProcessedTransactionHandler registers a handler for processed transaction messages.
func (*TransactionSubscriber) Run ¶
func (s *TransactionSubscriber) Run(ctx context.Context) error
Run starts the transaction subscriber's router.
func (*TransactionSubscriber) Stop ¶
func (s *TransactionSubscriber) Stop() error
Stop stops the transaction subscriber by closing the router and stopping all associated payment workers.
type TransactionSubscriberError ¶
type TransactionSubscriberError struct {
// contains filtered or unexported fields
}
TransactionSubscriberError represents an error encountered during creation transaction subscriber.
func NewTransactionSubscriberError ¶
func NewTransactionSubscriberError(msg string, err error) *TransactionSubscriberError
NewTransactionSubscriberError creates a new TransactionSubscriberError instance with the given message and error.
func (TransactionSubscriberError) Error ¶
func (e TransactionSubscriberError) Error() string