Skip to content

Commit e77c8f5

Browse files
committed
PR feedback, revert changes in ConnectionFactory
1 parent f5bf954 commit e77c8f5

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,15 @@ public sealed class ConnectionFactory : ConnectionFactoryBase, IAsyncConnectionF
189189

190190
// just here to hold the value that was set through the setter
191191
private Uri _uri;
192-
private readonly ArrayPool<byte> _memoryPool;
192+
private ArrayPool<byte> _memoryPool;
193193

194194
/// <summary>
195195
/// The memory pool used for allocating buffers. Default is <see cref="MemoryPool{T}.Shared"/>.
196196
/// </summary>
197197
public ArrayPool<byte> MemoryPool
198198
{
199-
get => _memoryPool;
199+
get { return _memoryPool; }
200+
set { _memoryPool = value ?? ArrayPool<byte>.Shared; }
200201
}
201202

202203
/// <summary>
@@ -268,18 +269,6 @@ public TimeSpan ContinuationTimeout
268269
public ConnectionFactory()
269270
{
270271
ClientProperties = Connection.DefaultClientProperties();
271-
_memoryPool = ArrayPool<byte>.Shared;
272-
}
273-
274-
/// <summary>
275-
/// Construct a fresh instance, with all fields set to their respective defaults,
276-
/// using your own memory pool.
277-
/// <param name="memoryPool">Memory pool to use with all Connections</param>
278-
/// </summary>
279-
public ConnectionFactory(ArrayPool<byte> memoryPool)
280-
{
281-
ClientProperties = Connection.DefaultClientProperties();
282-
_memoryPool = memoryPool;
283272
}
284273

285274
/// <summary>

0 commit comments

Comments
 (0)