snu-quiqcl / wlm-server-legacy

Server for controlling and monitoring High Finesse wavelength meter
0 stars 0 forks source link

Threaded scheduling for reading frequencies #7

Open BECATRUE opened 6 months ago

BECATRUE commented 6 months ago

Feature you want to implement

The main feature of this server is the management for reading frequencies through threaded scheduler. I will describe what should be implemented for this.

How the feature is implemented

  1. A synchronized queue.PriorityQueue object and a task object per each wlm channel. Once a request reading a frequency is received, the server (main) thread appends a task to the queue. And whenever a task arrives to the queue, the scheduler thread fetches and executes it.
  2. Read a frequency and create the next task for periodic requests.
  3. Websocket channel for offering frequencies in real time.
kangz12345 commented 6 months ago

As the server is continuously receiving the other requests, we should consider some corner cases for example the measurement is stopped while there are remaining tasks.