Skip to content

Commit a6e068c

Browse files
committed
work in progress
Signed-off-by: Gabriele Santomaggio <[email protected]>
1 parent a8ddb3e commit a6e068c

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

RabbitMQ.AMQP.Client/IConsumer.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,30 @@ public interface IContext
114114
/// <param name="annotations">Message annotations to combine with existing ones.</param>
115115
///</summary>
116116
void Requeue(Dictionary<string, object> annotations);
117+
118+
119+
/// <summary>
120+
/// Create a batch context to accumulate message contexts and settle them at once.
121+
/// The message context the batch context is created from is <b>not</b> added to the batch
122+
/// context.
123+
/// @return the created batch context
124+
/// </summary>
125+
IBatchContext Batch(int batchSizeHint);
126+
}
127+
128+
129+
public interface IBatchContext : IContext
130+
{
131+
/// <summary>
132+
/// Add a message context to the batch context.
133+
/// @param context the message context to add
134+
/// </summary>
135+
void Add(IContext context);
136+
137+
/// <summary>
138+
/// Get the current number of message contexts in the batch context.
139+
/// @return current number of message contexts in the batch
140+
/// </summary>
141+
int Size();
117142
}
118143
}

RabbitMQ.AMQP.Client/Impl/DeliveryContext.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,41 @@ public void Requeue(Dictionary<string, object> annotations)
145145
_message.Dispose();
146146
}
147147
}
148+
149+
public IBatchContext Batch(int batchSizeHint) => throw new System.NotImplementedException();
150+
}
151+
152+
public class BatchContext : IBatchContext
153+
{
154+
public void Accept()
155+
{
156+
throw new System.NotImplementedException();
157+
}
158+
159+
public void Discard()
160+
{
161+
throw new System.NotImplementedException();
162+
}
163+
164+
public void Discard(Dictionary<string, object> annotations)
165+
{
166+
throw new System.NotImplementedException();
167+
}
168+
169+
public void Requeue()
170+
{
171+
throw new System.NotImplementedException();
172+
}
173+
174+
public void Requeue(Dictionary<string, object> annotations)
175+
{
176+
throw new System.NotImplementedException();
177+
}
178+
179+
public IBatchContext Batch(int batchSizeHint) => throw new System.NotImplementedException();
180+
181+
public void Add(IContext context) => throw new System.NotImplementedException();
182+
183+
public int Size() => throw new System.NotImplementedException();
148184
}
149185
}

RabbitMQ.AMQP.Client/PublicAPI.Unshipped.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ RabbitMQ.AMQP.Client.IBackOffDelayPolicy.CurrentAttempt.get -> int
124124
RabbitMQ.AMQP.Client.IBackOffDelayPolicy.Delay() -> int
125125
RabbitMQ.AMQP.Client.IBackOffDelayPolicy.IsActive() -> bool
126126
RabbitMQ.AMQP.Client.IBackOffDelayPolicy.Reset() -> void
127+
RabbitMQ.AMQP.Client.IBatchContext
128+
RabbitMQ.AMQP.Client.IBatchContext.Add(RabbitMQ.AMQP.Client.IContext! context) -> void
129+
RabbitMQ.AMQP.Client.IBatchContext.Size() -> int
127130
RabbitMQ.AMQP.Client.IBindingSpecification
128131
RabbitMQ.AMQP.Client.IBindingSpecification.Argument(string! key, object! value) -> RabbitMQ.AMQP.Client.IBindingSpecification!
129132
RabbitMQ.AMQP.Client.IBindingSpecification.Arguments(System.Collections.Generic.Dictionary<string!, object!>! arguments) -> RabbitMQ.AMQP.Client.IBindingSpecification!
@@ -202,6 +205,7 @@ RabbitMQ.AMQP.Client.IConsumerBuilder.Stream() -> RabbitMQ.AMQP.Client.IConsumer
202205
RabbitMQ.AMQP.Client.IConsumerBuilder.SubscriptionListener(System.Action<RabbitMQ.AMQP.Client.IConsumerBuilder.ListenerContext!>! listenerContext) -> RabbitMQ.AMQP.Client.IConsumerBuilder!
203206
RabbitMQ.AMQP.Client.IContext
204207
RabbitMQ.AMQP.Client.IContext.Accept() -> void
208+
RabbitMQ.AMQP.Client.IContext.Batch(int batchSizeHint) -> RabbitMQ.AMQP.Client.IBatchContext!
205209
RabbitMQ.AMQP.Client.IContext.Discard() -> void
206210
RabbitMQ.AMQP.Client.IContext.Discard(System.Collections.Generic.Dictionary<string!, object!>! annotations) -> void
207211
RabbitMQ.AMQP.Client.IContext.Requeue() -> void
@@ -507,6 +511,16 @@ RabbitMQ.AMQP.Client.Impl.AmqpStreamSpecification.InitialClusterSize(int initial
507511
RabbitMQ.AMQP.Client.Impl.AmqpStreamSpecification.MaxAge(System.TimeSpan maxAge) -> RabbitMQ.AMQP.Client.IStreamSpecification!
508512
RabbitMQ.AMQP.Client.Impl.AmqpStreamSpecification.MaxSegmentSizeBytes(RabbitMQ.AMQP.Client.ByteCapacity! maxSegmentSize) -> RabbitMQ.AMQP.Client.IStreamSpecification!
509513
RabbitMQ.AMQP.Client.Impl.AmqpStreamSpecification.Queue() -> RabbitMQ.AMQP.Client.IQueueSpecification!
514+
RabbitMQ.AMQP.Client.Impl.BatchContext
515+
RabbitMQ.AMQP.Client.Impl.BatchContext.Accept() -> void
516+
RabbitMQ.AMQP.Client.Impl.BatchContext.Add(RabbitMQ.AMQP.Client.IContext! context) -> void
517+
RabbitMQ.AMQP.Client.Impl.BatchContext.Batch(int batchSizeHint) -> RabbitMQ.AMQP.Client.IBatchContext!
518+
RabbitMQ.AMQP.Client.Impl.BatchContext.BatchContext() -> void
519+
RabbitMQ.AMQP.Client.Impl.BatchContext.Discard() -> void
520+
RabbitMQ.AMQP.Client.Impl.BatchContext.Discard(System.Collections.Generic.Dictionary<string!, object!>! annotations) -> void
521+
RabbitMQ.AMQP.Client.Impl.BatchContext.Requeue() -> void
522+
RabbitMQ.AMQP.Client.Impl.BatchContext.Requeue(System.Collections.Generic.Dictionary<string!, object!>! annotations) -> void
523+
RabbitMQ.AMQP.Client.Impl.BatchContext.Size() -> int
510524
RabbitMQ.AMQP.Client.Impl.BindingSpecification
511525
RabbitMQ.AMQP.Client.Impl.BindingSpecification.ArgsToMap() -> Amqp.Types.Map!
512526
RabbitMQ.AMQP.Client.Impl.BindingSpecification.BindingSpecification() -> void

0 commit comments

Comments
 (0)