81 references to StreamItemMessage
Microsoft.AspNetCore.Components.Server (1)
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
156
return ApplyHeaders(headers, new
StreamItemMessage
(invocationId, value));
Microsoft.AspNetCore.Components.Server.Tests (6)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (6)
95
message: new
StreamItemMessage
("xyz", item: 42),
99
message: new
StreamItemMessage
("xyz", item: 42.0f),
103
message: new
StreamItemMessage
("xyz", item: "string"),
107
message: new
StreamItemMessage
("xyz", item: true),
421
new MessageSizeTestData("StreamItemMessage_WithNullItem", new
StreamItemMessage
("1", null), 7),
422
new MessageSizeTestData("StreamItemMessage_WithItem", new
StreamItemMessage
("1", 1), 7),
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
963
await SendWithLock(connectionState, new
StreamItemMessage
(streamId, item), tokenSource.Token).ConfigureAwait(false);
Microsoft.AspNetCore.SignalR.Common.Tests (26)
Internal\Protocol\JsonHubProtocolTests.cs (2)
157
JsonHubProtocol.WriteMessage(new
StreamItemMessage
("1", todo), writer);
215
new JsonProtocolTestData("StreamItemMessage_HasFloatItem", new
StreamItemMessage
("123", 2.0f), true, true, "{\"type\":2,\"invocationId\":\"123\",\"item\":2}"),
Internal\Protocol\JsonHubProtocolTestsBase.cs (12)
46
new JsonProtocolTestData("StreamItemMessage_HasHeaders", AddHeaders(TestHeaders, new
StreamItemMessage
("123", new CustomObject())), true, false, "{\"type\":2," + SerializedHeaders + ",\"invocationId\":\"123\",\"item\":{\"stringProp\":\"SignalR!\",\"doubleProp\":6.2831853071,\"intProp\":42,\"dateTimeProp\":\"2017-04-11T00:00:00Z\",\"nullProp\":null,\"byteArrProp\":\"AQID\"}}"),
47
new JsonProtocolTestData("StreamItemMessage_HasCustomItemWithNoCamelCase", new
StreamItemMessage
("123", new CustomObject()), false, true, "{\"type\":2,\"invocationId\":\"123\",\"item\":{\"StringProp\":\"SignalR!\",\"DoubleProp\":6.2831853071,\"IntProp\":42,\"DateTimeProp\":\"2017-04-11T00:00:00Z\",\"ByteArrProp\":\"AQID\"}}"),
48
new JsonProtocolTestData("StreamItemMessage_HasCustomItemWithNullValueIgnore", new
StreamItemMessage
("123", new CustomObject()), true, true, "{\"type\":2,\"invocationId\":\"123\",\"item\":{\"stringProp\":\"SignalR!\",\"doubleProp\":6.2831853071,\"intProp\":42,\"dateTimeProp\":\"2017-04-11T00:00:00Z\",\"byteArrProp\":\"AQID\"}}"),
49
new JsonProtocolTestData("StreamItemMessage_HasCustomItemWithNullValueIgnoreAndNoCamelCase", new
StreamItemMessage
("123", new CustomObject()), false, false, "{\"type\":2,\"invocationId\":\"123\",\"item\":{\"StringProp\":\"SignalR!\",\"DoubleProp\":6.2831853071,\"IntProp\":42,\"DateTimeProp\":\"2017-04-11T00:00:00Z\",\"NullProp\":null,\"ByteArrProp\":\"AQID\"}}"),
50
new JsonProtocolTestData("StreamItemMessage_HasCustomItemWithNullValueInclude", new
StreamItemMessage
("123", new CustomObject()), true, false, "{\"type\":2,\"invocationId\":\"123\",\"item\":{\"stringProp\":\"SignalR!\",\"doubleProp\":6.2831853071,\"intProp\":42,\"dateTimeProp\":\"2017-04-11T00:00:00Z\",\"nullProp\":null,\"byteArrProp\":\"AQID\"}}"),
51
new JsonProtocolTestData("StreamItemMessage_HasIntegerItem", new
StreamItemMessage
("123", 1), true, true, "{\"type\":2,\"invocationId\":\"123\",\"item\":1}"),
52
new JsonProtocolTestData("StreamItemMessage_HasStringItem", new
StreamItemMessage
("123", "Foo"), true, true, "{\"type\":2,\"invocationId\":\"123\",\"item\":\"Foo\"}"),
53
new JsonProtocolTestData("StreamItemMessage_HasBoolItem", new
StreamItemMessage
("123", true), true, true, "{\"type\":2,\"invocationId\":\"123\",\"item\":true}"),
54
new JsonProtocolTestData("StreamItemMessage_HasNullItem", new
StreamItemMessage
("123", null), true, true, "{\"type\":2,\"invocationId\":\"123\",\"item\":null}"),
107
new JsonProtocolTestData("StreamItemMessage_ItemFirst", new
StreamItemMessage
("1a", "foo"), false, true, "{ \"item\": \"foo\", \"invocationId\": \"1a\", \"type\":2 }")
369
new MessageSizeTestData("StreamItemMessage_WithNullItem", new
StreamItemMessage
("1", null), 42),
370
new MessageSizeTestData("StreamItemMessage_WithItem", new
StreamItemMessage
("1", 1), 39),
Internal\Protocol\MessagePackHubProtocolTestBase.cs (6)
95
message: new
StreamItemMessage
("xyz", item: 42),
99
message: new
StreamItemMessage
("xyz", item: 42.0f),
103
message: new
StreamItemMessage
("xyz", item: "string"),
107
message: new
StreamItemMessage
("xyz", item: true),
421
new MessageSizeTestData("StreamItemMessage_WithNullItem", new
StreamItemMessage
("1", null), 7),
422
new MessageSizeTestData("StreamItemMessage_WithItem", new
StreamItemMessage
("1", 1), 7),
Internal\Protocol\MessagePackHubProtocolTests.cs (5)
141
message: new
StreamItemMessage
("xyz", item: null),
145
message: new
StreamItemMessage
("xyz", item: TestEnum.One),
149
message: new
StreamItemMessage
("xyz", item: new CustomObject()),
153
message: new
StreamItemMessage
("xyz", item: new[] { new CustomObject(), new CustomObject() }),
157
message: AddHeaders(TestHeaders, new
StreamItemMessage
("xyz", item: new[] { new CustomObject(), new CustomObject() })),
Internal\Protocol\NewtonsoftJsonHubProtocolTests.cs (1)
101
new JsonProtocolTestData("StreamItemMessage_HasFloatItem", new
StreamItemMessage
("123", 2.0f), true, true, "{\"type\":2,\"invocationId\":\"123\",\"item\":2.0}"),
Microsoft.AspNetCore.SignalR.Core (1)
Internal\DefaultHubDispatcher.cs (1)
559
var streamItemMessage = new
StreamItemMessage
(invocationId, null);
Microsoft.AspNetCore.SignalR.Microbenchmarks (4)
DefaultHubDispatcherBenchmark.cs (4)
345
await _dispatcher.DispatchMessageAsync(_connectionContext, new
StreamItemMessage
("1", "test"));
356
await _dispatcher.DispatchMessageAsync(_connectionContext, new
StreamItemMessage
("1", "test"));
369
await _dispatcher.DispatchMessageAsync(_connectionContext, new
StreamItemMessage
("1", "test"));
383
await _dispatcher.DispatchMessageAsync(_connectionContext, new
StreamItemMessage
("1", "test"));
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
770
return new
StreamItemMessage
(invocationId, item);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Protocol\MessagePackHubProtocolWorker.cs (1)
156
return ApplyHeaders(headers, new
StreamItemMessage
(invocationId, value));
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Protocol\NewtonsoftJsonHubProtocol.cs (1)
763
return new
StreamItemMessage
(invocationId, item);
Microsoft.AspNetCore.SignalR.Tests (39)
HubConnectionHandlerTests.cs (26)
2026
HubConnectionHandlerTestUtils.AssertHubMessage(new
StreamItemMessage
(string.Empty, "0"), messages[0]);
2027
HubConnectionHandlerTestUtils.AssertHubMessage(new
StreamItemMessage
(string.Empty, "1"), messages[1]);
2028
HubConnectionHandlerTestUtils.AssertHubMessage(new
StreamItemMessage
(string.Empty, "2"), messages[2]);
2029
HubConnectionHandlerTestUtils.AssertHubMessage(new
StreamItemMessage
(string.Empty, "3"), messages[3]);
3606
await client.SendHubMessageAsync(new
StreamItemMessage
("id", letter)).DefaultTimeout();
3630
await client.SendHubMessageAsync(new
StreamItemMessage
("id", letter)).DefaultTimeout();
3654
await client.SendHubMessageAsync(new
StreamItemMessage
("id", thing)).DefaultTimeout();
3690
await client.SendHubMessageAsync(new
StreamItemMessage
(spot.ToString(CultureInfo.InvariantCulture), words[spot][pos[spot]])).DefaultTimeout();
3747
await client.SendHubMessageAsync(new
StreamItemMessage
("id", thing)).DefaultTimeout();
3876
await client.SendHubMessageAsync(new
StreamItemMessage
("id", 5)).DefaultTimeout();
3877
await client.SendHubMessageAsync(new
StreamItemMessage
("id", 10)).DefaultTimeout();
3928
await client.SendHubMessageAsync(new
StreamItemMessage
("channelId", "not a number")).DefaultTimeout();
3951
await client.SendHubMessageAsync(new
StreamItemMessage
("fake_id", "not a number")).DefaultTimeout();
4064
await client.SendHubMessageAsync(new
StreamItemMessage
("id", "hello")).DefaultTimeout();
4065
await client.SendHubMessageAsync(new
StreamItemMessage
("id", " world")).DefaultTimeout();
4105
await client.SendHubMessageAsync(new
StreamItemMessage
("id", "hello")).DefaultTimeout();
4106
await client.SendHubMessageAsync(new
StreamItemMessage
("id", " world")).DefaultTimeout();
4139
await client.SendHubMessageAsync(new
StreamItemMessage
("id", "ignored")).DefaultTimeout();
4146
await client.SendHubMessageAsync(new
StreamItemMessage
("id", "error!")).DefaultTimeout();
4176
await client.SendHubMessageAsync(new
StreamItemMessage
("id", "ignored")).DefaultTimeout();
4183
await client.SendHubMessageAsync(new
StreamItemMessage
("id", "error!")).DefaultTimeout();
4426
await client.SendHubMessageAsync(new
StreamItemMessage
(streamId, phrase));
4493
HubConnectionHandlerTestUtils.AssertHubMessage(new
StreamItemMessage
(string.Empty, argument.Value), messages[0]);
4576
await client.SendHubMessageAsync(new
StreamItemMessage
("id", "hello")).DefaultTimeout();
4718
await client.SendHubMessageAsync(new
StreamItemMessage
("1", 1)).DefaultTimeout();
4719
await client.SendHubMessageAsync(new
StreamItemMessage
("1", 14)).DefaultTimeout();
Internal\MessageBufferTests.cs (13)
56
var writeTask = messageBuffer.WriteAsync(new SerializedHubMessage(new
StreamItemMessage
("id", null)), default);
132
await messageBuffer.WriteAsync(new
StreamItemMessage
("id", null), default);
181
await messageBuffer.WriteAsync(new
StreamItemMessage
("id", null), default);
251
await messageBuffer.WriteAsync(new
StreamItemMessage
("1", null), default).DefaultTimeout();
294
var writeTask = messageBuffer.WriteAsync(new SerializedHubMessage(new
StreamItemMessage
("id", null)), default);
329
await messageBuffer.WriteAsync(new
StreamItemMessage
("1", null), default);
335
await messageBuffer.WriteAsync(new
StreamItemMessage
("1", null), default);
336
await messageBuffer.WriteAsync(new
StreamItemMessage
("1", null), default);
373
Assert.True(messageBuffer.ShouldProcessMessage(new
StreamItemMessage
("1", null)));
374
Assert.True(messageBuffer.ShouldProcessMessage(new
StreamItemMessage
("1", null)));
386
Assert.True(messageBuffer.ShouldProcessMessage(new
StreamItemMessage
("1", null)));
461
Assert.True(messageBuffer.ShouldProcessMessage(new
StreamItemMessage
("1", null)));
462
Assert.True(messageBuffer.ShouldProcessMessage(new
StreamItemMessage
("1", null)));