java - LMAX Disruptor as a blocking queue? -
is there way can have both in 1 structure -
- semantics of blockingqueue, ie - non blocking peek, blocking poll , blocking put. multiple providers 1 consumer.
- ringbuffer, works object pool, instead of putting new object in ring buffer, want reuse existing object there, copying state. functionality lmax disruptor has out of box.
is there works already? guess can try , use disruptor that, can use blocking queue blocking put(if ring buffer "full") if understand correctly. has "reusable objects" semantics need. problem how create client able pull objects(instead of using callbacks), i'm not familiar internal disruptor structure - can done? sequencers, creating new eventprocessor or that?
and no, obvious solution of having blocking queue on client side , getting not ideal solution, breaks whole point of using disruptor object pool - you'll need have new pool now, or create new objects in callback before putting in blocking queue etc, , don't want have garbage created @ all.
so there way achieve disruptor, or other performance oriented/garbage free java library?
we open sourced conversant diruptor includes diruptorblockingqueue earlier year. can find code on github
conversant disruptor trivial include in project because supports blockingqueue api , published on maven central.
Comments
Post a Comment