Home > Back-end >  Online auction websocket multiple projects at the same time how ah
Online auction websocket multiple projects at the same time how ah

Time:09-29

To good effect, without using ajax request 1 SEC under the background, the current brush up the latest price, want to use the websocket, but involve more than one commodity auction at the same time, how to do ah, such as zhang SAN into the no. 1 auction, also can enter the auction, 2 or 3 auction, can offer at the same time, and then bid after using websocket automatically update the price recently, let people can see the price updates immediately taken into

CodePudding user response:

Someone bid, this value is stored, and notify the number all the players in the auction, updated values,
To take this value, no

CodePudding user response:

The
reference 1/f, a reply from the underlying program apes looked:
someone bid, this value is stored, and notify the number all the players in the auction, updated values,
To take this value, no

Well what about inside, how the data real-time refresh

CodePudding user response:

Someone bid, notice in the auction, all the people at the same time,
Simply write a return message to the players in the auction, get out

CodePudding user response:

reference 3/f a reply from the underlying program apes looked:
someone bid, we will notify in the auction, at the same time all,
Simply write a return message, will the auction number of players get out notice

Well, now is to allow A person in the multiple auction room at the same time, such as zhang SAN again in the auction room, A and B in the auction room, if I bid auction in A city, as long as the push information into A auction room zhang SAN, don't inform B auction room zhang SAN, because is not the same goods, to how to deal with this?

CodePudding user response:

Take a chestnut:
The map==& gt; Store all the websocket
Map1 & lt; Commodity id,...>===& gt; Storage for users who participate in items 1 websocket
Map2 & lt; Commodity id,...>===& gt; Store goods 2 user websocket

CodePudding user response:

Normally speaking, the current in A auction room, and participated in A bid auction room, is to inform
Two buffer, a storage current auction room, a storage room for an auction, when convenient price change notification

CodePudding user response:

It is really not well, I see how you oh, seo hui

CodePudding user response:

reference 4 floor fanqieo response:
Quote: look from the underlying program apes reference 3 floor response:
someone bid, we will notify in the auction number and all the people,
Simply write a return message, will the auction number of players get out notice

Well, now is to allow A person in the multiple auction room at the same time, such as zhang SAN again in the auction room, A and B in the auction room, if I bid auction in A city, as long as the push information into A auction room zhang SAN, don't inform B auction room zhang SAN, because is not the same goods, to how to deal with this?


So-called notice, actually similar to radio, as long as you subscribe to, will receive notification, as to whether to deal with this after you receive the notice, shall be the responsibility of the recipient, the sender is not responsible for, otherwise the sender to deal with things too much,

CodePudding user response:

Can use the websocket to do ah, a separate ID between each auction, a new real-time prices pushed to the ID, just to get the data displayed on the front page, websocket push can try GoEasy, address: https://www.goeasy.io/
  • Related