c# - WCF service data caching technique -


currently wcf service provides method in api performs health check of specific device in same local network. simplified version of method:

public status devicehealthcheck() {      return device.isalive() ? status::alive : status.not_responding; } 

the problem device.isalive() establishes network connection device , when lot of clients call devicehealthcheck() network traffic turns out huge bottleneck.

i create 1 thread work time in background , call device.isalive() every few second , update variable working cache. @ stage devicehealthcheck() might this:

public status devicehealthcheck() {      return cachedhealthstatus; } 

i don't know how create such background thread in wcf service. or maybe there solution problem?


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -