MCPcopy Create free account
hub / github.com/acl-dev/acl / handle_task

Method handle_task

lib_fiber/cpp/src/keeper/keeper_conn.cpp:169–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169void keeper_conn::handle_task(task_req& task)
170{
171 if (conn_ == NULL) {
172 connect_one();
173 }
174
175 socket_stream* conn;
176 if (conn_) {
177 // must dup the sock fd for moving the connection from
178 // one thread started in fiber schedule mode to another.
179 conn = dup_stream(*conn_);
180 delete conn_;
181 conn_ = NULL;
182 status_ = KEEPER_T_IDLE;
183 } else {
184 conn = NULL;
185 status_ = KEEPER_T_IDLE;
186 }
187
188 // notify the request task with the connection
189 task.set_conn_cost(conn_cost_);
190 task.put(conn);
191}
192
193void keeper_conn::connect_one()
194{

Callers

nothing calls this directly

Calls 2

set_conn_costMethod · 0.80
putMethod · 0.45

Tested by

no test coverage detected