Home > Net > Bosses, is there a better way of thinking to every five open a thread to update data?
Bosses, is there a better way of thinking to every five open a thread to update data?
Time:11-26
ORM use EF6, such as: is there a better way of advice or to every five open a thread to update data?
Logic, for example: article database with 1000 data need to be updated, but this article 1000 data interface need to request a third party or to update the data to the results, and needs to be updated regularly, every 3 s are going to finish the 1000 data
CodePudding user response:
The questions don't understand, you want what?
I also don't want to guess, as each of your five update
Don't want to write so many complex code, the use of recent human thinking mode of Reactive Extensions (Rx) for. NET Nuget introduced System. Reactive
Subject Xx=new Subject (a); T I don't know is what, I fill out according to the circumstance //here you have the thread, the parallel or I don't care If you receive a data
Xx. OnNext (receive)
Xx. Buffer (5)//cache 5 Subscription (lst5=& gt; { //the lst5 are 5 a set, you want yourself to update the database })