2 #include "DataFormats/TestObjects/interface/ToyProducts.h" 29 std::unique_ptr<test_acquire::Cache> beginStream(
edm::StreamID)
const override;
38 void endJob()
override;
43 std::vector<edm::EDGetTokenT<IntProduct>>
m_tokens;
45 std::unique_ptr<test_acquire::WaitingServer>
m_server;
51 : m_numberOfStreamsToAccumulate(
pset.getUntrackedParameter<unsigned
int>(
"streamsToAccumulate", 8)),
52 m_secondsToWaitForWork(
pset.getUntrackedParameter<unsigned
int>(
"secondsToWaitForWork", 1)) {
53 for (
auto const&
tag :
pset.getParameter<std::vector<edm::InputTag>>(
"tags")) {
57 produces<IntProduct>();
67 m_server = std::make_unique<test_acquire::WaitingServer>(
73 return std::make_unique<test_acquire::Cache>();
80 std::this_thread::sleep_for(1
s);
94 std::this_thread::sleep_for(1
s);
97 for (
auto v : streamCache(streamID)->processed()) {
100 event.put(std::make_unique<IntProduct>(sum));
edm::EDGetTokenT< IntProduct > m_tokenForProduce
TEMPL(T2) struct Divides void
std::vector< edm::EDGetTokenT< IntProduct > > m_tokens
std::unique_ptr< test_acquire::WaitingServer > m_server
std::unique_ptr< test_acquire::Cache > beginStream(edm::StreamID) const override
void preallocate(edm::PreallocationConfiguration const &) override
unsigned int numberOfStreams() const
~AcquireIntProducer() override
#define DEFINE_FWK_MODULE(type)
AcquireIntProducer(edm::ParameterSet const &pset)
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const override
const unsigned int m_secondsToWaitForWork
const unsigned int m_numberOfStreamsToAccumulate
std::vector< int > const & processed() const
unsigned int value() const
void acquire(edm::StreamID, edm::Event const &, edm::EventSetup const &, edm::WaitingTaskWithArenaHolder) const override
std::vector< int > const & retrieved() const