How to ignore multiple browser connections or lock temporarily the server?

11 views
Skip to first unread message

Marco Comini

unread,
Sep 11, 2019, 11:53:35 AM9/11/19
to HAppS
Hi all,
  I'm using Happstack since a while. I'm very happy with it, however I have an issue that frankly I don't now how to fix. I've searched the history and I didn't find something that seems to help me, so I'm bothering.

In my server I'm logging some info on the activities and I've noticed that frequently in the logs there are duplicated log messages, which very likely is related to the server that is servicing duplicated requests by my browser. Unfortunately there is a task that is very demanding and I would to be able to force somehow the serialization of these requests. I was thinking to do it by blocking the other requests until this has finished, but did not found in the crash course how to do it.  Besides it could be the wrong way to solve/circumvent the issue.

Can someone give me some idea/suggestions?

Thank you.

Jeremy Shaw

unread,
Sep 11, 2019, 9:18:19 PM9/11/19
to HAppS
Hello,

The current version of happstack-server does not give you the option to directly control the accept loop. That is something I plan to fix in the next generation.

However, there may be a sensible way to achieve what you want.

I think what you could do is use an STM semaphore,


Before a handler can enter the demanding task section it has to first get the semaphore.



Does that make sense?

- jeremy


--
You received this message because you are subscribed to the Google Groups "HAppS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to happs+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/happs/77ef0234-f266-4e1b-b44f-0db2ae82c35b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages