concurrent-programs | Complementary Concurrency Programs for course `` Linux | Android library
kandi X-RAY | concurrent-programs Summary
kandi X-RAY | concurrent-programs Summary
Complementary Concurrency Programs for course "Linux Kernel Internals"
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of concurrent-programs
concurrent-programs Key Features
concurrent-programs Examples and Code Snippets
Community Discussions
Trending Discussions on concurrent-programs
QUESTION
I want to write a simple load balancer for some requests coming into a C# web api app.
(I only use the C# stuff as a convenient way to create a web server).
Whats the best way to approach this? (I havent really done any mailbox stuff in F#) If I were to use mailboxes/agents...then I post the request as a message, fine...but how do I get the response back to web api request handler?
Isnt it all fire and forget? (I have, ironically, done some erlang)
(I CAN have a simple mutable global index of which is the next worker service to handle the request...but this is my opportunity to do it nicely).
actually I think I may have done something very similar to this in erlang, and I think the initiator would pass a return address where to send the message back (and the return address was the process id of the initiator), it would then wait for the response, and when it gets it (or times out), it would then do whatever it needed to do.
Is that a sensible mechanism in F#?
------------------------ edit ------------------------
So, https://www.codemag.com/Article/1707051/Writing-Concurrent-Programs-Using-F describes a similar set up and it seems I need to use, and actually this works, but it ISNT quite the same mechanism as my Erlang suggestion about. Here each client sends a PostAndReply, and then waits for the response before replying back.....that seems unnecessary, ideally the reply would go all the way back to the origin, and the intermediaries would fire and forget in between.
...ANSWER
Answered 2020-Dec-18 at 13:30D'oh, what I need to do is actually UNDERSTAND the example, rather than just hack together code!
if the reply agent just forwards it...then we're done.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install concurrent-programs
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page