Dynamically specify type on publish
Make loopback transport thread safe