Add an external thread to manage the internal piepeline

Change-Id: I71e0084bb314b98adf9e85744d047800a168cfb6
httpendpoint: Remove elements from external thread

Change-Id: I53e1e45f583ca5f7a33847a8d28ac2279c63a6a9