Giter Club home page Giter Club logo

chunkit's Introduction

ReadMe.md

Author: Richard Maher [email protected]

Release: 23-Aug-2023 - Initial POC release.

Predictor - General purpose Javascript List of Values Object

Raison D'etre: - To test the amazing functionality afforded the Web Developer by C# Controller IAsyncEnumerable, and provide examples of output digestion in both Javascript and C# clients.

The streaming of JSON output between producer and consumer creates the infrastructure to support parallelism, with both client and server being able to add-value to the results simultaneously. No more thin-client/forms-based interaction. Rows, or results, can begin to be dissplayed on the web-page as soon as they are available. No waiting for a complete result-set/collection to be delivered atomically, but rather a production-line of UI widgets being rendered as and when available.

But the real diamond hiding in this example is the use of Cancellation Tokens facilitating the cancellation of server processing from a remote client!

public async IAsyncEnumerable<dynamic> yieldLastName(string inName, [EnumeratorCancellation]CancellationToken cancellationToken)

Whether due to time-out, a user hitting a hot cancel button, or a now redundant query being superseded by fresh input, there are no orphaned run-away server tasks. And no user wall-time frustration.

This is a paradigm shift in result-set data retrieval!

Run-time test considerations

This repository is just a Visual Studio 2022 solution with two projects: -

ChunkIt - A Core WebApi application that productes a web page to query the Person table in

StreamIt - A tiny Console App to show the beauty of JsonSerializer.DeserializeAsyncEnumerable! Once you've looked at the hand-rolled "pipeFactory" Iterator in _Layout.cshtml you'll realize the heavy-lifting the Deserializer does for you.

How To Run It -

  • Open the ChunkIt solution in VS2023 and build it. Make sure you have a copy of the AdventureWorld database and modify the connection String in AppSettings.json to point to it.

  • Set the startup Project to ChunkIt and start it without debug. A Web Page will appear wwhere you can enter partial Last Names and Predictor will retrieve any matches.

  • Set the startup project to StreamIt and start it with debug and see a list of matches for a hard-coded value.

That's it! All feedback welcomed!

chunkit's People

Contributors

richardmaher avatar

Watchers

 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.