-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Queues] Add retry mechanism + Add nullable package (#126)
* add logic for message retries * add nullable package * rename misc to pkg * use int32 instead of int * add to queue the updated message for keeping track of retries * add declare with config queue method * reject message on final retry * add msg retries in consumer config * update MaxRetries comment * refactor nullable package + include more data types
- Loading branch information
Showing
6 changed files
with
153 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package nullable | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
func String(s string) *string { | ||
return &s | ||
} | ||
|
||
func Stringf(s string, args ...interface{}) *string { | ||
s = fmt.Sprintf(s, args...) | ||
return &s | ||
} | ||
|
||
func Int(i int) *int { | ||
return &i | ||
} | ||
|
||
func Int8(i int8) *int8 { | ||
return &i | ||
} | ||
|
||
func Int16(i int16) *int16 { | ||
return &i | ||
} | ||
|
||
func Int32(i int32) *int32 { | ||
return &i | ||
} | ||
|
||
func Int64(i int64) *int64 { | ||
return &i | ||
} | ||
|
||
func Uint(i uint) *uint { | ||
return &i | ||
} | ||
|
||
func Uint8(i uint8) *uint8 { | ||
return &i | ||
} | ||
|
||
func Uint16(i uint16) *uint16 { | ||
return &i | ||
} | ||
|
||
func Uint32(i uint32) *uint32 { | ||
return &i | ||
} | ||
|
||
func Uint64(i uint64) *uint64 { | ||
return &i | ||
} | ||
|
||
func Float32(f float32) *float32 { | ||
return &f | ||
} | ||
|
||
func Float64(f float64) *float64 { | ||
return &f | ||
} | ||
|
||
func Bool(b bool) *bool { | ||
return &b | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package nullable | ||
|
||
import "time" | ||
|
||
func Time(t time.Time) *time.Time { | ||
return &t | ||
} |