Add basic thread_encoder