Skip to content

Commit 9bb7058

Browse files
committed
Rename model -> channel, _model -> _channel, etc
1 parent de0a0b4 commit 9bb7058

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+490
-490
lines changed

projects/Benchmarks/ConsumerDispatching/AsyncBasicConsumerFake.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void IBasicConsumer.HandleBasicDeliver(string consumerTag, ulong deliveryTag, bo
4444

4545
public Task HandleBasicConsumeOk(string consumerTag) => Task.CompletedTask;
4646

47-
public Task HandleModelShutdown(object model, ShutdownEventArgs reason) => Task.CompletedTask;
47+
public Task HandleModelShutdown(object channel, ShutdownEventArgs reason) => Task.CompletedTask;
4848

4949
public IChannel Model { get; }
5050

@@ -68,7 +68,7 @@ void IBasicConsumer.HandleBasicConsumeOk(string consumerTag)
6868
{
6969
}
7070

71-
void IBasicConsumer.HandleModelShutdown(object model, ShutdownEventArgs reason)
71+
void IBasicConsumer.HandleModelShutdown(object channel, ShutdownEventArgs reason)
7272
{
7373
}
7474

projects/Benchmarks/Networking/Networking_BasicDeliver_Commons.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ public class Networking_BasicDeliver_Commons
1212
public static async Task Publish_Hello_World(IConnection connection, uint messageCount, byte[] body)
1313
{
1414
var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
15-
using (var model = connection.CreateModel())
15+
using (var channel = connection.CreateModel())
1616
{
17-
var queue = model.QueueDeclare();
17+
var queue = channel.QueueDeclare();
1818
var consumed = 0;
19-
var consumer = new EventingBasicConsumer(model);
19+
var consumer = new EventingBasicConsumer(channel);
2020
consumer.Received += (s, args) =>
2121
{
2222
if (Interlocked.Increment(ref consumed) == messageCount)
2323
{
2424
tcs.SetResult(true);
2525
}
2626
};
27-
model.BasicConsume(queue.QueueName, true, consumer);
27+
channel.BasicConsume(queue.QueueName, true, consumer);
2828

2929
for (int i = 0; i < messageCount; i++)
3030
{
31-
model.BasicPublish("", queue.QueueName, body);
31+
channel.BasicPublish("", queue.QueueName, body);
3232
}
3333

3434
await tcs.Task;

projects/RabbitMQ.Client/client/api/AsyncDefaultBasicConsumer.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ public AsyncDefaultBasicConsumer()
2121
/// <summary>
2222
/// Constructor which sets the Model property to the given value.
2323
/// </summary>
24-
/// <param name="model">Common AMQP model.</param>
25-
public AsyncDefaultBasicConsumer(IChannel model)
24+
/// <param name="channel">Common AMQP channel.</param>
25+
public AsyncDefaultBasicConsumer(IChannel channel)
2626
{
27-
Model = model;
27+
Model = channel;
2828
}
2929

3030
/// <summary>
@@ -120,11 +120,11 @@ public virtual Task HandleBasicDeliver(string consumerTag,
120120
}
121121

122122
/// <summary>
123-
/// Called when the model (channel) this consumer was registered on terminates.
123+
/// Called when the channel (channel) this consumer was registered on terminates.
124124
/// </summary>
125-
/// <param name="model">A channel this consumer was registered on.</param>
125+
/// <param name="channel">A channel this consumer was registered on.</param>
126126
/// <param name="reason">Shutdown context.</param>
127-
public virtual Task HandleModelShutdown(object model, ShutdownEventArgs reason)
127+
public virtual Task HandleModelShutdown(object channel, ShutdownEventArgs reason)
128128
{
129129
ShutdownReason = reason;
130130
return OnCancel(_consumerTags.ToArray());
@@ -170,7 +170,7 @@ void IBasicConsumer.HandleBasicDeliver(string consumerTag, ulong deliveryTag, bo
170170
throw new InvalidOperationException("Should never be called. Enable 'DispatchConsumersAsync'.");
171171
}
172172

173-
void IBasicConsumer.HandleModelShutdown(object model, ShutdownEventArgs reason)
173+
void IBasicConsumer.HandleModelShutdown(object channel, ShutdownEventArgs reason)
174174
{
175175
throw new InvalidOperationException("Should never be called. Enable 'DispatchConsumersAsync'.");
176176
}

projects/RabbitMQ.Client/client/api/DefaultBasicConsumer.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public DefaultBasicConsumer()
6060
/// <summary>
6161
/// Constructor which sets the Model property to the given value.
6262
/// </summary>
63-
/// <param name="model">Common AMQP model.</param>
64-
public DefaultBasicConsumer(IChannel model)
63+
/// <param name="channel">Common AMQP channel.</param>
64+
public DefaultBasicConsumer(IChannel channel)
6565
{
66-
Model = model;
66+
Model = channel;
6767
}
6868

6969
/// <summary>
@@ -159,11 +159,11 @@ public virtual void HandleBasicDeliver(string consumerTag,
159159
}
160160

161161
/// <summary>
162-
/// Called when the model (channel) this consumer was registered on terminates.
162+
/// Called when the channel (channel) this consumer was registered on terminates.
163163
/// </summary>
164-
/// <param name="model">A channel this consumer was registered on.</param>
164+
/// <param name="channel">A channel this consumer was registered on.</param>
165165
/// <param name="reason">Shutdown context.</param>
166-
public virtual void HandleModelShutdown(object model, ShutdownEventArgs reason)
166+
public virtual void HandleModelShutdown(object channel, ShutdownEventArgs reason)
167167
{
168168
ShutdownReason = reason;
169169
OnCancel(_consumerTags.ToArray());

projects/RabbitMQ.Client/client/api/IAsyncBasicConsumer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ Task HandleBasicDeliver(string consumerTag,
5555
ReadOnlyMemory<byte> body);
5656

5757
/// <summary>
58-
/// Called when the model shuts down.
58+
/// Called when the channel shuts down.
5959
/// </summary>
60-
/// <param name="model"> Common AMQP model.</param>
61-
/// <param name="reason"> Information about the reason why a particular model, session, or connection was destroyed.</param>
62-
Task HandleModelShutdown(object model, ShutdownEventArgs reason);
60+
/// <param name="channel"> Common AMQP channel.</param>
61+
/// <param name="reason"> Information about the reason why a particular channel, session, or connection was destroyed.</param>
62+
Task HandleModelShutdown(object channel, ShutdownEventArgs reason);
6363
}
6464
}

projects/RabbitMQ.Client/client/api/IBasicConsumer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ void HandleBasicDeliver(string consumerTag,
9898
ReadOnlyMemory<byte> body);
9999

100100
/// <summary>
101-
/// Called when the model shuts down.
101+
/// Called when the channel shuts down.
102102
/// </summary>
103-
/// <param name="model"> Common AMQP model.</param>
104-
/// <param name="reason"> Information about the reason why a particular model, session, or connection was destroyed.</param>
105-
void HandleModelShutdown(object model, ShutdownEventArgs reason);
103+
/// <param name="channel"> Common AMQP channel.</param>
104+
/// <param name="reason"> Information about the reason why a particular channel, session, or connection was destroyed.</param>
105+
void HandleModelShutdown(object channel, ShutdownEventArgs reason);
106106
}
107107
}

projects/RabbitMQ.Client/client/api/IChannel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ public interface IChannel : IDisposable
8383
IBasicConsumer DefaultConsumer { get; set; }
8484

8585
/// <summary>
86-
/// Returns true if the model is no longer in a state where it can be used.
86+
/// Returns true if the channel is no longer in a state where it can be used.
8787
/// </summary>
8888
bool IsClosed { get; }
8989

9090
/// <summary>
91-
/// Returns true if the model is still in a state where it can be used.
91+
/// Returns true if the channel is still in a state where it can be used.
9292
/// Identical to checking if <see cref="CloseReason"/> equals null.</summary>
9393
bool IsOpen { get; }
9494

@@ -124,7 +124,7 @@ public interface IChannel : IDisposable
124124
event EventHandler<BasicReturnEventArgs> BasicReturn;
125125

126126
/// <summary>
127-
/// Signalled when an exception occurs in a callback invoked by the model.
127+
/// Signalled when an exception occurs in a callback invoked by the channel.
128128
///
129129
/// Examples of cases where this event will be signalled
130130
/// include exceptions thrown in <see cref="IBasicConsumer"/> methods, or
@@ -135,10 +135,10 @@ public interface IChannel : IDisposable
135135
event EventHandler<FlowControlEventArgs> FlowControl;
136136

137137
/// <summary>
138-
/// Notifies the destruction of the model.
138+
/// Notifies the destruction of the channel.
139139
/// </summary>
140140
/// <remarks>
141-
/// If the model is already destroyed at the time an event
141+
/// If the channel is already destroyed at the time an event
142142
/// handler is added to this event, the event handler will be fired immediately.
143143
/// </remarks>
144144
event EventHandler<ShutdownEventArgs> ModelShutdown;

projects/RabbitMQ.Client/client/api/IConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public interface IConnection : INetworkConnection, IDisposable
226226
void Close(ushort reasonCode, string reasonText, TimeSpan timeout, bool abort);
227227

228228
/// <summary>
229-
/// Create and return a fresh channel, session, and model.
229+
/// Create and return a fresh channel, session, and channel.
230230
/// </summary>
231231
IChannel CreateModel();
232232
}

0 commit comments

Comments
 (0)