Make FairMQSampler generic