@@ -10,6 +10,7 @@ import (
1010 "fmt"
1111 "github.com/oracle/coherence-go-client/v2/coherence/filters"
1212 pb1topics "github.com/oracle/coherence-go-client/v2/proto/topics"
13+ "time"
1314)
1415
1516type ReceiveStatus int32
@@ -29,15 +30,28 @@ type EnsureSubscriberResult struct {
2930 UUID string
3031}
3132
32- type ReceiveResult [V any ] struct {
33- Status ReceiveStatus
34- }
35-
3633// Options provides options for creating a subscriber.
3734type Options struct {
3835 SubscriberGroup * string
3936 Filter filters.Filter
4037 Extractor []byte
38+ AutoCommit bool
39+ MaxMessages int32
40+ }
41+
42+ // CommitResponse represents th response from a [Subscriber] commit.
43+ type CommitResponse struct {
44+ Channel int32
45+ Position * pb1topics.TopicPosition
46+ Head * pb1topics.TopicPosition
47+ }
48+
49+ // ReceiveResponse represents a response from a [Subscriber] receive request.
50+ type ReceiveResponse [V any ] struct {
51+ Channel int32
52+ Value * V
53+ Position * pb1topics.TopicPosition
54+ Timestamp time.Time
4155}
4256
4357// TODO: Additional options
@@ -61,6 +75,20 @@ func WithFilter(fltr filters.Filter) func(options *Options) {
6175 }
6276}
6377
78+ // WithAutoCommit returns a function to set auto commit to be true for a [Subscriber].
79+ func WithAutoCommit () func (options * Options ) {
80+ return func (s * Options ) {
81+ s .AutoCommit = true
82+ }
83+ }
84+
85+ // WithMaxMessages returns a function to set the maximum messages for a[Subscriber].
86+ func WithMaxMessages (maxMessages int32 ) func (options * Options ) {
87+ return func (s * Options ) {
88+ s .MaxMessages = maxMessages
89+ }
90+ }
91+
6492// WithTransformer returns a function to set the extractor [Subscriber].
6593func WithTransformer (extractor []byte ) func (options * Options ) {
6694 return func (s * Options ) {
0 commit comments