-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prepare streaming in management sdk. (#2129)
- Loading branch information
Showing
18 changed files
with
1,226 additions
and
940 deletions.
There are no files selected for viewing
25 changes: 13 additions & 12 deletions
25
src/Microsoft.Azure.SignalR.Common/Utilities/Rest/BinaryPayloadContentBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Net.Http; | ||
|
||
using Microsoft.AspNetCore.SignalR.Protocol; | ||
|
||
#nullable enable | ||
|
||
namespace Microsoft.Azure.SignalR.Common | ||
namespace Microsoft.Azure.SignalR.Common; | ||
|
||
internal class BinaryPayloadContentBuilder : IPayloadContentBuilder | ||
{ | ||
internal class BinaryPayloadContentBuilder : IPayloadContentBuilder | ||
private readonly IReadOnlyList<IHubProtocol> _hubProtocols; | ||
|
||
public BinaryPayloadContentBuilder(IReadOnlyList<IHubProtocol> hubProtocols) | ||
{ | ||
private readonly IReadOnlyList<IHubProtocol> _hubProtocols; | ||
public BinaryPayloadContentBuilder(IReadOnlyList<IHubProtocol> hubProtocols) | ||
{ | ||
_hubProtocols = hubProtocols; | ||
} | ||
_hubProtocols = hubProtocols; | ||
} | ||
|
||
public HttpContent? Build(PayloadMessage? payload) | ||
{ | ||
return payload == null ? null : (HttpContent)new BinaryPayloadMessageContent(payload, _hubProtocols); | ||
} | ||
public HttpContent? Build(HubMessage? payload, Type? typeHint) | ||
{ | ||
return payload == null ? null : (HttpContent)new BinaryPayloadMessageContent(payload, _hubProtocols); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
src/Microsoft.Azure.SignalR.Common/Utilities/Rest/IPayloadContentBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Net.Http; | ||
|
||
using Microsoft.AspNetCore.SignalR.Protocol; | ||
|
||
#nullable enable | ||
|
||
namespace Microsoft.Azure.SignalR.Common | ||
namespace Microsoft.Azure.SignalR.Common; | ||
|
||
internal interface IPayloadContentBuilder | ||
{ | ||
internal interface IPayloadContentBuilder | ||
{ | ||
HttpContent? Build(PayloadMessage? payload); | ||
} | ||
HttpContent? Build(HubMessage? payload, Type? typeHint); | ||
} |
30 changes: 16 additions & 14 deletions
30
src/Microsoft.Azure.SignalR.Common/Utilities/Rest/JsonPayloadContentBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Net.Http; | ||
|
||
using Azure.Core.Serialization; | ||
|
||
using Microsoft.AspNetCore.SignalR.Protocol; | ||
|
||
#nullable enable | ||
namespace Microsoft.Azure.SignalR.Common | ||
namespace Microsoft.Azure.SignalR.Common; | ||
|
||
internal class JsonPayloadContentBuilder : IPayloadContentBuilder | ||
{ | ||
internal class JsonPayloadContentBuilder : IPayloadContentBuilder | ||
{ | ||
private readonly ObjectSerializer _jsonObjectSerializer; | ||
private readonly ObjectSerializer _jsonObjectSerializer; | ||
|
||
public JsonPayloadContentBuilder(ObjectSerializer jsonObjectSerializer) | ||
{ | ||
_jsonObjectSerializer = jsonObjectSerializer; | ||
} | ||
public JsonPayloadContentBuilder(ObjectSerializer jsonObjectSerializer) | ||
{ | ||
_jsonObjectSerializer = jsonObjectSerializer; | ||
} | ||
|
||
public HttpContent? Build(PayloadMessage? payload) | ||
{ | ||
return payload == null ? null : new JsonPayloadMessageContent(payload, _jsonObjectSerializer); | ||
} | ||
public HttpContent? Build(HubMessage? payload, Type? typeHint) | ||
{ | ||
return payload == null ? null : new JsonPayloadMessageContent(payload, _jsonObjectSerializer, typeHint); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.