I am trying to develop a mechanism to collaborate with many processes - goroutines. There are two classes of processes - providers and users. Suppliers queue their bids for their services, and users accept pending bids and start working with suppliers. However, the user may not like the proposal, and then two things should happen:
- This rate must be returned to the queue. It should be placed at the beginning of the queue.
- The user should be offered the next bid in line
Ideally, I would like to avoid the central process that coordinates the communication between providers and users. Another way to think about this problem is to imagine a “peeping” queue or channel. The concept is similar to how AWS Kinesis works. The reader can access the "peek" at the head of the lineup. As this reader peeks, no other reader sees this subject. The reader likes the item, then it removes it from the queue. If not the reader releases the element lock, another reader can peek.
Any ideas on how to best implement this behavior in Go using feeds and goroutines?
source
share