Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  01 May 2022, Konstantin Olchanski, Info, added web page for "mdump" 
    Reply  01 May 2022, Konstantin Olchanski, Info, added web page for "mdump" 
    Reply  01 May 2022, Konstantin Olchanski, Info, added web page for "mdump" 
       Reply  02 May 2022, Stefan Ritt, Info, added web page for "mdump" 
Message ID: 2391     Entry time: 01 May 2022     In reply to: 2390
Author: Konstantin Olchanski 
Topic: Info 
Subject: added web page for "mdump" 
> added JSON RPC for bm_receive_event()

there is a number of problems with implementing bm_receive_event() as a RPC:

1) mhttpd has only event buffer 1 read pointer for all javascript connections, if two browser tabs are 
running mdump, they will "steal" events from each other.
2) javascript connections are state-less and we cannot specify per-connection event_id and trigger_mask 
filters to bm_receive_event(). our bm_request_event() has to be for all event_id and all trigger_mask.
3) for same reason, we cannot have some requests to be GET_ALL, some to be GET_RECENT and some to be 
GET_OLD (if GET_OLD is ever implemented).

Problem (1) is hard to fix. Only solution I can see is to have mhttpd have it's own event buffer that can 
somehow track which events have been sent to which javascript connection.

The same scheme allows implementing GET_ALL and per-connection event_id and trigger_mask filters.

The difficulty is in detecting javascript connections that are no longer active and it's event request and 
events we have buffered for it can be deleted. Unlike proper rpc clients, javascript browser tabs can be 
closed without warning and without opportunity to tell rpc server that they are closed, gone.

K.O.
ELOG V3.1.4-2e1708b5