Home > Back-end >  Netty how to perform multiple tasks regularly
Netty how to perform multiple tasks regularly

Time:01-24

The server using netty, background is as follows:

each equipment mounted under multiple nodes, data of each device node need to reply between the server and equipment instructions issued and completed,
Equipment under A001, for example, temperature, humidity, atmospheric pressure three parameters, equipment and the server after the connection is established, the server need to need active instruction issued by temperature equipment about temperature numerical response, and then distributed humidity instructions for equipment reply (instruction sequence is not necessarily)

Now need customer custom each node of the data acquisition cycle, such as temperature every 20 s to get a humidity every 30 s to get once,,,,,,,,


The current thinking is to each node a timer, but feel the cost performance was too much

Please each great god provides a train of thought, better circumstances, many devices need to be taken into account (and more device node)

CodePudding user response:

This kind of situation usually devices to send task set a timer on their own, and then the time configuration and start the distributed configuration can have a service

CodePudding user response:

If must serve to timing, can only write an actuator constantly testing the seconds to get temperature equipment list, and then still into the task queue by thread pool executes instructions issued,
30 s is equivalent to the equipment is divided into 30 queue, the map has 30 key,

CodePudding user response:

But if the device is too much, too many nodes, each node can't a timer
  • Related