Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[osgi-users] PushStreamProvider builder concern

We noticed a couple of issues with the PushStreamProvider interface

For example the following compile and runs but doesn't operate as expected:
psp = new PushStreamProvider();
spes = psp.buildSimpleEventSource(Event.class)
  .withBuffer(new LinkedBlockingQueue<>())
  .withExecutor(executor)
  .withParallelism(executor.getMaximumPoolSize())
  .withScheduler(customScheduler)
  .withQueuePolicy(QueuePolicyOption.BLOCK)
  .build();

The 2 highlighted lines are ignored in this case AFAICT, but that is not rejected or documented anywhere.
From some digging in the code, the parallelism is only used when an executor is not specified.

For the scheduler we have to define it later with:
psp.buildStream(spes)
  .withScheduler(customScheduler)
  ...

Am I missing something or shouldn't there be added checks or at the very least clear documentation about this?

Cheers,
Alain


Back to the top