iproto: implement streams in iproto
Implement streams in iproto. There is a hash table of streams for each connection. When a new request comes with a non-zero stream ID, we look for the stream with such ID in this table and if it does not exist, we create it. The request is placed in the queue of pending requests, and if this queue was empty at the time of its receipt, it is pushed to the tx thread for processing. When a request belonging to stream returns to the network thread after processing is completed, we take the next request out of the queue of pending requests and send it for processing to tx thread. If there is no pending requests we remove stream object from hash table and destroy it. Requests with zero stream ID are processed in the old way. Part of #5860 @TarantoolBot document Title: streams are implemented in iproto A distinctive feature of streams is that all requests in them are processed sequentially. The execution of the next request in stream will not start until the previous one is completed. To separate requests belonging to and not belonging to streams we use stream ID field in binary iproto protocol: requests with non-zero stream ID belongs to some stream. Stream ID is unique within the connection and indicates which stream the request belongs to. For streams from different connections, the IDs may be the same.
Showing
- src/box/errcode.h 1 addition, 0 deletionssrc/box/errcode.h
- src/box/iproto.cc 220 additions, 5 deletionssrc/box/iproto.cc
- src/lib/core/errinj.h 2 additions, 0 deletionssrc/lib/core/errinj.h
- test/box/errinj.result 2 additions, 0 deletionstest/box/errinj.result
- test/box/error.result 1 addition, 0 deletionstest/box/error.result
Loading
Please register or sign in to comment