Create, setup and schedule the background fetch continuation.
| 222 | |
| 223 | // Create, setup and schedule the background fetch continuation. |
| 224 | void |
| 225 | BgFetchData::schedule() |
| 226 | { |
| 227 | TSAssert(nullptr == _cont); |
| 228 | |
| 229 | // Setup the continuation |
| 230 | _cont = TSContCreate(cont_bg_fetch, TSMutexCreate()); |
| 231 | TSContDataSet(_cont, static_cast<void *>(this)); |
| 232 | |
| 233 | // Initialize the VIO stuff (for the fetch) |
| 234 | req_io_buf = TSIOBufferCreate(); |
| 235 | req_io_buf_reader = TSIOBufferReaderAlloc(req_io_buf); |
| 236 | resp_io_buf = TSIOBufferCreate(); |
| 237 | resp_io_buf_reader = TSIOBufferReaderAlloc(resp_io_buf); |
| 238 | |
| 239 | // Schedule |
| 240 | TSContScheduleOnPool(_cont, 0, TS_THREAD_POOL_NET); |
| 241 | } |
| 242 | |
| 243 | ////////////////////////////////////////////////////////////////////////////// |
| 244 | // Continuation to perform a background fill of a URL. This is pretty |
no test coverage detected