Go to file
Patrick Stevens ffa63df305 Add GH action (#1)
2021-02-17 19:21:36 +00:00
2021-02-17 19:21:36 +00:00
2021-02-17 16:09:34 +00:00
2021-02-17 18:18:01 +00:00
2021-02-17 19:01:01 +00:00

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.

Description
A toy example server designed to provide low-latency views of external data
Readme MIT 125 KiB
Languages
F# 100%