Registers codec for payload type P.
Replaces any previously registered codec for the same type. Safe to call from multiple threads.
PayloadCodec.register<OrderEvent>(orderCodec)
The payload type to register a codec for.
The codec to register.