Sharing Top Content from the Angular-sphere.

nuget for relay server npm for angular 5 client Added a demo app

nuget for relay server
npm for angular 5 client
Added a demo app

  • A gang has a set of members running the same code with one member designated as the host.
  • The host executes the command and broadcasts the current state to all members.
  • Gangs are controlled by a single relay server, but the work is done by the current host.
  • When you run the app, the relay will be running on – – There is a support for Angular 5 can install it from npm in the usual way.
  • sln – – This is a simple Gang ToDo app, written with Angular 5 and TypeScript with a DotNet Core relay – – Make sure you build the client app, then – – Run in visual studio and the ui will popup up, open as many browsers on that url…

gang – websocket relay in c# dotnetcore

We recommend upgrading to the latest Safari, Google Chrome, or Firefox.

GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.

State sharing algorithm.

A gang has a set of members running the same code with one member designated as the host.

All members can issue commands, these are sent to the current host. The host executes the command and broadcasts the current state to all members.

Should the host be disconnected from the gang, an other becomes the host.

Gangs are controlled by a single relay server, but the work is done by the current host.

Create a new Asp.Net Core Web Application

Add nuget package for Gang.WebSockets

In Startup.cs, configure services in Startup.ConfigureServices

Start the gang relay in Startup.Configure

There is a support for Angular 5 https://www.npmjs.com/package/ng-gang

You can install it from npm in the usual way.

Have a look at the demo app code here https://github.com/MrAntix/gang/tree/master/demo/Gang.Demo/client/app/todo

e.g.

Subscribe to the commands, and call your handlers to alter the state calling gang.sendState() with the mutated state. e.g.

Subscribe to state updates, this will pass new states from the host to your client, simply replace your state with the new one. (note here I have an apply method to turn the json coming from the server…

GitHub

Comments are closed, but trackbacks and pingbacks are open.