-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatus.go
More file actions
45 lines (33 loc) · 1.25 KB
/
status.go
File metadata and controls
45 lines (33 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package sqshandler
/*
Status defines the four possible states a Worker can report to
the [Handler]. These states are:
# SUCCESS
Denotes that the message has been processed successfully and thus
can be safely removed from the queue.
# SKIP
Denotes that the message is not relevant and has thus been skipped.
Functionally identical to SUCCESS, used for reporting purposes.
# RETRY
Denotes that the message was not processed successfully due to a
transient error. This signals the [Handler] to return the message
to the queue with an updated [VisibilityTimeout], following its
[Backoff] configuration.
# FAILURE
Denotes that the message was not processed successfully due to
immutable reasons that cannot be solved by simply retrying the
operation. This signals the [Handler] to send this message to
a DLQ, if one was specified during configuration, and then to
remove said message from the queue.
[VisibilityTimeout]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
*/
type Status string
const (
Failure Status = "FAILURE"
Retry Status = "RETRY"
Skip Status = "SKIP"
Success Status = "SUCCESS"
)
func (s *Status) isValid() bool {
return (*s == Failure || *s == Retry || *s == Skip || *s == Success)
}