Is it possible to reduce the circular buffer to "1"? Is that a good idea?

By default, 1000 messages are placed in the ring buffer on the server by default.

It makes no sense for me to send 1000 updates to the delayed client, but most likely the latest update. In WCF, I can do this using mutable data.

I suppose that I can emulate a volatile approach by decreasing the buffer to "1", but I'm not sure that this can be configured on a per-node basis or, ideally, on a per-method basis.

Does it matter if I use hubs or persistent connections with this?

+4
source share
1 answer

DefaultMessageBufferSize 1, SignalR , 32 .

, , SignalR . 1, , , .

, , . , SignalR "" . 32 , . , .

, , , . SignalR "". "" , , , PersistentConnection ( Connection.Broadcast) ( Clients.All). Clients.All , .

EDIT: SignalR , :

using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Configuration;
using Owin;

// ...

public void Configuration(IAppBuilder app)
{
    // The following will setup a SignalR endpoint at "/signalr"
    // using settings from GlobalHost
    app.MapSignalR();

    var resolver = new DefaultDependencyResolver();
    var configuration = resolver.Resolve<IConfigurationManager>();

    configuration.DefaultMessageBufferSize = 32;

    // By specifying or own dependency resolver, we tell the
    // "/volatile" endpoint not to use settings from GlobalHost
    app.MapSignalR("/volatile", new HubConfiguration
    {
        Resolver = resolver
    });
}

// ...
+4

All Articles