Giter VIP home page Giter VIP logo

lucasledesma / signalrdemo Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.25 MB

This repository contains code that demos the different ways to enable real time communication between the browser and the server. And in the case of signalR, between the different clients connected to the hub too.

C# 11.70% HTML 3.56% CSS 0.71% JavaScript 2.82% TypeScript 81.22%
signalr websockets serversentevents longpolling polling

signalrdemo's Introduction

Real Time Web

lucasledesma

⚠️ DISCLAIMER: This code is only for demo purposes and should not be used as production code by any reason. Code structure is not following best practices. Also, it is not recommended to use plain javascript but a library (like i.e. react) instead, etc. Use it to learn, but nothing else.- ⚠️

In this repository you can find different ways to get real time (or near real time) updates in the browser.

I demonstrate the following mechanisms:

  • Polling
  • Long Polling
  • Server Sent Events
  • Websockets
  • SignalR

For the last case, SignalR, I also show how to create a DotNet Console Client.

I also show how SignalR can be combined with a workflow engine, in this case Zeebe, to obtain real time notifications about the different steps of a workflow.

Projects in this repository

Building

At the root of the project run the following command to build all the projects.

dotnet build

The solution file SignalRDemo.sln contains all the subprojects.

Running

At the root of the project you can run each project with these commands.

dotnet run --project Webapp

dotnet run --project ConsoleClient

dotnet run --project ZeebeClient

Workflow

ZeebeClient project tries to connect to a Zeebe instance running in http://localhost:26500 . This is the default location for zeebe engine. To try this you can start zeebe and an instance of zeebe simple monitor as shown in the following location: https://github.com/zeebe-io/zeebe-docker-compose

The client will connect to the engine and deploy the demo workflow that is contained in the same project. Once deployed it will subscribe the handlers for the different workflow steps. The handlers just connect to the SignalRHub and notifies the workflow instance creator about updates.

CI/CD

A ci/cd pipeline to automatically build these projects was created using CircleCi.

Screenshots

Polling

alt text

Long Polling

alt text

Server Sent Events

alt text

Web Sockets

alt text

SingalR

alt text

Workflow

alt text

signalrdemo's People

Contributors

lucasledesma avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.