Skip to content

Commit 7098fee

Browse files
committed
Move ShutdownEventArgs to RabbitMQ.Client.Events
Remove `RabbitMQ.Client.client.impl` namespace. Move files in `RabbitMQ.Client` namespace to where they are expected in directory structure. Move util classes. Capitalize `Util` directory Remove unused `TypeExtensions` methods Move DictionaryExtensions to the correct location Move `TaskExtensions.cs` to the correct location. Move `RentedMemory.cs` to the correct location Move `Logging` namespace classes to the correct directory Move `Impl` namespace classes to the correct directory Move `Framing` namespace classes to the correct directory Rename all `RabbitMQ.Client.Framing.Impl` to `RabbitMQ.Client.Framing` Move Exceptions and Events directories to their correct locations Move `ConsumerDispatching` class files to the correct location. Move `Constants.cs` to the correct location
1 parent 9dab7bc commit 7098fee

File tree

231 files changed

+629
-288
lines changed

Some content is hidden

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

231 files changed

+629
-288
lines changed

projects/Benchmarks/ConsumerDispatching/AsyncBasicConsumerFake.cs

+33-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
1-
using System;
1+
// This source code is dual-licensed under the Apache License, version
2+
// 2.0, and the Mozilla Public License, version 2.0.
3+
//
4+
// The APL v2.0:
5+
//
6+
//---------------------------------------------------------------------------
7+
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
8+
//
9+
// Licensed under the Apache License, Version 2.0 (the "License");
10+
// you may not use this file except in compliance with the License.
11+
// You may obtain a copy of the License at
12+
//
13+
// https://www.apache.org/licenses/LICENSE-2.0
14+
//
15+
// Unless required by applicable law or agreed to in writing, software
16+
// distributed under the License is distributed on an "AS IS" BASIS,
17+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
// See the License for the specific language governing permissions and
19+
// limitations under the License.
20+
//---------------------------------------------------------------------------
21+
//
22+
// The MPL v2.0:
23+
//
24+
//---------------------------------------------------------------------------
25+
// This Source Code Form is subject to the terms of the Mozilla Public
26+
// License, v. 2.0. If a copy of the MPL was not distributed with this
27+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
28+
//
29+
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
30+
//---------------------------------------------------------------------------
31+
32+
using System;
233
using System.Threading;
334
using System.Threading.Tasks;
435
using RabbitMQ.Client;
36+
using RabbitMQ.Client.Events;
537

638
namespace RabbitMQ.Benchmarks
739
{

projects/Benchmarks/WireFormatting/MethodFraming.cs

+33-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
1-
using System;
1+
// This source code is dual-licensed under the Apache License, version
2+
// 2.0, and the Mozilla Public License, version 2.0.
3+
//
4+
// The APL v2.0:
5+
//
6+
//---------------------------------------------------------------------------
7+
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
8+
//
9+
// Licensed under the Apache License, Version 2.0 (the "License");
10+
// you may not use this file except in compliance with the License.
11+
// You may obtain a copy of the License at
12+
//
13+
// https://www.apache.org/licenses/LICENSE-2.0
14+
//
15+
// Unless required by applicable law or agreed to in writing, software
16+
// distributed under the License is distributed on an "AS IS" BASIS,
17+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
// See the License for the specific language governing permissions and
19+
// limitations under the License.
20+
//---------------------------------------------------------------------------
21+
//
22+
// The MPL v2.0:
23+
//
24+
//---------------------------------------------------------------------------
25+
// This Source Code Form is subject to the terms of the Mozilla Public
26+
// License, v. 2.0. If a copy of the MPL was not distributed with this
27+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
28+
//
29+
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
30+
//---------------------------------------------------------------------------
31+
32+
using System;
233
using System.Text;
334

435
using BenchmarkDotNet.Attributes;
536
using RabbitMQ.Client;
6-
using RabbitMQ.Client.client.impl;
7-
using RabbitMQ.Client.Framing.Impl;
37+
using RabbitMQ.Client.Framing;
838
using RabbitMQ.Client.Impl;
939

1040
namespace RabbitMQ.Benchmarks

projects/Benchmarks/WireFormatting/MethodSerialization.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using BenchmarkDotNet.Attributes;
55
using RabbitMQ.Client;
6-
using RabbitMQ.Client.Framing.Impl;
6+
using RabbitMQ.Client.Framing;
77

88
namespace RabbitMQ.Benchmarks
99
{

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

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Linq;
44
using System.Threading;
55
using System.Threading.Tasks;
6+
using RabbitMQ.Client.Events;
67

78
namespace RabbitMQ.Client
89
{

projects/RabbitMQ.Client/client/api/BasicProperties.cs renamed to projects/RabbitMQ.Client/BasicProperties.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
using System;
3333
using System.Collections.Generic;
3434
using System.Diagnostics.CodeAnalysis;
35-
using RabbitMQ.Client.Framing.Impl;
35+
using RabbitMQ.Client.Framing;
3636
using RabbitMQ.Client.Impl;
3737

3838
namespace RabbitMQ.Client

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
using System.Threading;
4141
using System.Threading.Tasks;
4242
using RabbitMQ.Client.Exceptions;
43-
using RabbitMQ.Client.Framing.Impl;
43+
using RabbitMQ.Client.Framing;
4444
using RabbitMQ.Client.Impl;
4545

4646
namespace RabbitMQ.Client

projects/RabbitMQ.Client/client/impl/ConsumerDispatching/ConsumerDispatcherBase.cs renamed to projects/RabbitMQ.Client/ConsumerDispatching/ConsumerDispatcherBase.cs

+33-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
1-
using System.Collections.Concurrent;
1+
// This source code is dual-licensed under the Apache License, version
2+
// 2.0, and the Mozilla Public License, version 2.0.
3+
//
4+
// The APL v2.0:
5+
//
6+
//---------------------------------------------------------------------------
7+
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
8+
//
9+
// Licensed under the Apache License, Version 2.0 (the "License");
10+
// you may not use this file except in compliance with the License.
11+
// You may obtain a copy of the License at
12+
//
13+
// https://www.apache.org/licenses/LICENSE-2.0
14+
//
15+
// Unless required by applicable law or agreed to in writing, software
16+
// distributed under the License is distributed on an "AS IS" BASIS,
17+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
// See the License for the specific language governing permissions and
19+
// limitations under the License.
20+
//---------------------------------------------------------------------------
21+
//
22+
// The MPL v2.0:
23+
//
24+
//---------------------------------------------------------------------------
25+
// This Source Code Form is subject to the terms of the Mozilla Public
26+
// License, v. 2.0. If a copy of the MPL was not distributed with this
27+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
28+
//
29+
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
30+
//---------------------------------------------------------------------------
31+
32+
using System.Collections.Concurrent;
233
using System.Collections.Generic;
334
using System.Runtime.CompilerServices;
435
using System.Threading.Tasks;
36+
using RabbitMQ.Client.Events;
537

638
namespace RabbitMQ.Client.ConsumerDispatching
739
{
+33-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
1-
using System;
1+
// This source code is dual-licensed under the Apache License, version
2+
// 2.0, and the Mozilla Public License, version 2.0.
3+
//
4+
// The APL v2.0:
5+
//
6+
//---------------------------------------------------------------------------
7+
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
8+
//
9+
// Licensed under the Apache License, Version 2.0 (the "License");
10+
// you may not use this file except in compliance with the License.
11+
// You may obtain a copy of the License at
12+
//
13+
// https://www.apache.org/licenses/LICENSE-2.0
14+
//
15+
// Unless required by applicable law or agreed to in writing, software
16+
// distributed under the License is distributed on an "AS IS" BASIS,
17+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
// See the License for the specific language governing permissions and
19+
// limitations under the License.
20+
//---------------------------------------------------------------------------
21+
//
22+
// The MPL v2.0:
23+
//
24+
//---------------------------------------------------------------------------
25+
// This Source Code Form is subject to the terms of the Mozilla Public
26+
// License, v. 2.0. If a copy of the MPL was not distributed with this
27+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
28+
//
29+
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
30+
//---------------------------------------------------------------------------
31+
32+
using System;
233
using System.Threading;
334
using System.Threading.Channels;
435
using System.Threading.Tasks;
5-
36+
using RabbitMQ.Client.Events;
637
using RabbitMQ.Client.Impl;
738
using RabbitMQ.Client.Logging;
839

projects/RabbitMQ.Client/client/impl/ConsumerDispatching/FallbackConsumer.cs renamed to projects/RabbitMQ.Client/ConsumerDispatching/FallbackConsumer.cs

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
1-
using System;
1+
//
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// https://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
//---------------------------------------------------------------------------
14+
//
15+
// The MPL v2.0:
16+
//
17+
//---------------------------------------------------------------------------
18+
// This Source Code Form is subject to the terms of the Mozilla Public
19+
// License, v. 2.0. If a copy of the MPL was not distributed with this
20+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
21+
//
22+
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
23+
//---------------------------------------------------------------------------
24+
25+
using System;
226
using System.Threading;
327
using System.Threading.Tasks;
28+
using RabbitMQ.Client.Events;
429
using RabbitMQ.Client.Logging;
530

631
namespace RabbitMQ.Client.ConsumerDispatching

projects/RabbitMQ.Client/client/impl/ConsumerDispatching/IConsumerDispatcher.cs renamed to projects/RabbitMQ.Client/ConsumerDispatching/IConsumerDispatcher.cs

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
using System;
3333
using System.Threading;
3434
using System.Threading.Tasks;
35+
using RabbitMQ.Client.Events;
3536

3637
namespace RabbitMQ.Client.ConsumerDispatching
3738
{

projects/RabbitMQ.Client/FrameworkExtension/DictionaryExtension.cs renamed to projects/RabbitMQ.Client/DictionaryExtension.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
3030
//---------------------------------------------------------------------------
3131

32+
#if NETSTANDARD
3233
using System.Collections.Generic;
3334

34-
namespace RabbitMQ
35+
namespace RabbitMQ.Client
3536
{
36-
#if NETSTANDARD
3737
internal static class DictionaryExtension
3838
{
3939
public static bool Remove<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, out TValue value)
4040
{
4141
return dictionary.TryGetValue(key, out value) && dictionary.Remove(key);
4242
}
4343
}
44-
#endif
4544
}
45+
#endif

projects/RabbitMQ.Client/client/api/ShutdownEventArgs.cs renamed to projects/RabbitMQ.Client/Events/ShutdownEventArgs.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,15 @@
3131

3232
using System;
3333
using System.Threading;
34-
using RabbitMQ.Client.Events;
3534

36-
namespace RabbitMQ.Client
35+
namespace RabbitMQ.Client.Events
3736
{
3837
/// <summary>
3938
/// Information about the reason why a particular channel, session, or connection was destroyed.
4039
/// </summary>
4140
/// <remarks>
4241
/// The <see cref="ClassId"/> and <see cref="Initiator"/> properties should be used to determine the originator of the shutdown event.
4342
/// </remarks>
44-
/// TODO: Should this be moved to the events folder and the namespace be adjusted?
4543
public class ShutdownEventArgs : AsyncEventArgs
4644
{
4745
private readonly Exception? _exception;

projects/RabbitMQ.Client/client/exceptions/AlreadyClosedException.cs renamed to projects/RabbitMQ.Client/Exceptions/AlreadyClosedException.cs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
//---------------------------------------------------------------------------
3131

3232
using System;
33+
using RabbitMQ.Client.Events;
3334

3435
namespace RabbitMQ.Client.Exceptions
3536
{

projects/RabbitMQ.Client/client/exceptions/OperationInterruptedException.cs renamed to projects/RabbitMQ.Client/Exceptions/OperationInterruptedException.cs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
//---------------------------------------------------------------------------
3131

3232
using System;
33+
using RabbitMQ.Client.Events;
3334

3435
namespace RabbitMQ.Client.Exceptions
3536
{

projects/RabbitMQ.Client/client/exceptions/ProtocolException.cs renamed to projects/RabbitMQ.Client/Exceptions/ProtocolException.cs

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
// Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
3030
//---------------------------------------------------------------------------
3131

32+
using RabbitMQ.Client.Events;
33+
3234
namespace RabbitMQ.Client.Exceptions
3335
{
3436
/// <summary> Instances of subclasses of subclasses

projects/RabbitMQ.Client/client/exceptions/UnexpectedMethodException.cs renamed to projects/RabbitMQ.Client/Exceptions/UnexpectedMethodException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//---------------------------------------------------------------------------
3131

3232
using System;
33-
using RabbitMQ.Client.client.framing;
33+
using RabbitMQ.Client.Framing;
3434

3535
namespace RabbitMQ.Client.Exceptions
3636
{

projects/RabbitMQ.Client/client/impl/AmqpVersion.cs renamed to projects/RabbitMQ.Client/Framing/AmqpVersion.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
using System;
3333

34-
namespace RabbitMQ.Client.Framing.Impl
34+
namespace RabbitMQ.Client.Framing
3535
{
3636
/// <summary>Represents a version of the AMQP specification.</summary>
3737
/// <remarks>

projects/RabbitMQ.Client/client/framing/BasicAck.cs renamed to projects/RabbitMQ.Client/Framing/BasicAck.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@
3131

3232
using System;
3333
using System.Runtime.CompilerServices;
34-
35-
using RabbitMQ.Client.client.framing;
3634
using RabbitMQ.Client.Impl;
3735

38-
namespace RabbitMQ.Client.Framing.Impl
36+
namespace RabbitMQ.Client.Framing
3937
{
4038
internal readonly struct BasicAck : IOutgoingAmqpMethod
4139
{

projects/RabbitMQ.Client/client/framing/BasicCancel.cs renamed to projects/RabbitMQ.Client/Framing/BasicCancel.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@
3030
//---------------------------------------------------------------------------
3131

3232
using System;
33-
34-
using RabbitMQ.Client.client.framing;
3533
using RabbitMQ.Client.Impl;
3634

37-
namespace RabbitMQ.Client.Framing.Impl
35+
namespace RabbitMQ.Client.Framing
3836
{
3937
internal readonly struct BasicCancel : IOutgoingAmqpMethod
4038
{

projects/RabbitMQ.Client/client/framing/BasicCancelOk.cs renamed to projects/RabbitMQ.Client/Framing/BasicCancelOk.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@
3030
//---------------------------------------------------------------------------
3131

3232
using System;
33-
34-
using RabbitMQ.Client.client.framing;
3533
using RabbitMQ.Client.Impl;
3634

37-
namespace RabbitMQ.Client.Framing.Impl
35+
namespace RabbitMQ.Client.Framing
3836
{
3937
internal readonly struct BasicCancelOk : IAmqpMethod
4038
{

projects/RabbitMQ.Client/client/framing/BasicConsume.cs renamed to projects/RabbitMQ.Client/Framing/BasicConsume.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@
3131

3232
using System;
3333
using System.Collections.Generic;
34-
35-
using RabbitMQ.Client.client.framing;
3634
using RabbitMQ.Client.Impl;
3735

38-
namespace RabbitMQ.Client.Framing.Impl
36+
namespace RabbitMQ.Client.Framing
3937
{
4038
internal readonly struct BasicConsume : IOutgoingAmqpMethod
4139
{

projects/RabbitMQ.Client/client/framing/BasicConsumeOk.cs renamed to projects/RabbitMQ.Client/Framing/BasicConsumeOk.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@
3030
//---------------------------------------------------------------------------
3131

3232
using System;
33-
34-
using RabbitMQ.Client.client.framing;
3533
using RabbitMQ.Client.Impl;
3634

37-
namespace RabbitMQ.Client.Framing.Impl
35+
namespace RabbitMQ.Client.Framing
3836
{
3937
internal readonly struct BasicConsumeOk : IAmqpMethod
4038
{

0 commit comments

Comments
 (0)