Skip to content
This repository was archived by the owner on Dec 15, 2024. It is now read-only.

Smaug123/pulsing-server

Repository files navigation

This is my answer to https://github.com/JerryDot/Webscraping-Webserver .

It comes in two parts: a small library which supplies the moving parts, and then a whale of an ASP.NET server to demonstrate it.

PulsingServer library

This is a small library that defines two entities based on MailboxProcessors. One entity (ServerAgent) sits ready to serve requests based on the latest information pushed into it. One entity (ExternalInfoProvider) repeatedly calls an Async to obtain new information, and pushes it into the ServerAgents.

This way, we can ensure that only one entity is obtaining new information for the system, with low latency for responses via the ServerAgent, and no concurrency issues (because each ServerAgent maintains its own copy of the latest state).

ASP.NET server

The server demonstrates the library in the most naive possible way, scraping a web page every 500ms to find the current time.

This incidentally demonstrates that you can distribute load across multiple ServerAgents, although in fact the example does not do any distributing.

About

A toy example server designed to provide low-latency views of external data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages