timer

package
v1.0.68 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimerService

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

func NewTimerService

func NewTimerService(orderRequestSvc *order_request.OrderRequestService) *TimerService

NewTimerService creates a new instance of TimerService with the given order request service.

func (*TimerService) StartOrderRequestTimer

func (s *TimerService) StartOrderRequestTimer(orderRequestID string, timeout time.Duration)

StartOrderRequestTimer sets a timer for an order request.

This method initiates a countdown for the specified order request ID. If the order request remains in the "Pending" status and is not claimed by any merchant (MerchantID is nil) by the end of the timeout duration, the order request will be automatically cancelled with a "Timeout" reason.

Params:

  • orderRequestID (string): The ID of the order request to set the timer for.
  • timeout (time.Duration): The duration after which the order request should be cancelled if unclaimed.

Jump to

Keyboard shortcuts

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