async` networking layer was implemented in MongoDB's `mongos` server to handle scatter-gather queries efficiently. The old approach of running requests serially caused thread explosion due to the large number of shards, leading to performance issues. An alternative solution was developed using an `async` outbound networking layer, which eliminates the need for threads and reduces contention over hardware resources. However, this new implementation brought challenges such as managing memory and ensuring state survival across tasks. To address these issues, a hybrid approach combining persistent structures and C++ shared pointers was used to package tasks into bite-sized work items that can be run concurrently. The system also enforces a rule where only the primary path of execution can end a task, preventing race conditions and segmentation faults.