func NewAssembler(flushTimer time.Duration, packetsBuffer *Buffer, sharedPacketPoolManager *PoolManager, packetSourceType SourceType) *Assembler {
	packetAssembler := &Assembler{
		// retrieve an available packet from the packet pool,
		// which will be pushed back by the server when processed.
		packet:                  sharedPacketPoolManager.Get().(*Packet),
		sharedPacketPoolManager: sharedPacketPoolManager,
		packetsBuffer:           packetsBuffer,
		flushTimer:              time.NewTicker(flushTimer),
		packetSourceType:        packetSourceType,
		closeChannel:            make(chan struct{}),
	}
	go packetAssembler.flushLoop()
	return packetAssembler
}
// NewAssembler creates a new Assembler instance using the specified flush duration, buffer and pool manager
NewAssembler creates a new Assembler instance using the specified flush duration, buffer and pool manager
// NewAssembler creates a new Assembler instance using the specified flush duration buffer and pool manager
func NewAssembler(flushTimer time.Duration, packetsBuffer *Buffer, sharedPacketPoolManager *PoolManager, packetSourceType SourceType) *Assembler {
	packetAssembler := &Assembler{
		packet:                  sharedPacketPoolManager.Get().(*Packet),
		sharedPacketPoolManager: sharedPacketPoolManager,
		packetsBuffer:           packetsBuffer,
		flushTimer:              time.NewTicker(flushTimer),
		packetSourceType:        packetSourceType,
		closeChannel:            make(chan struct{}),
	}
	go packetAssembler.flushLoop()
	return packetAssembler
}
func NewAssembler ( flushTimer time . Duration , packetsBuffer * Buffer , sharedPacketPoolManager * PoolManager , packetSourceType SourceType ) * Assembler { packetAssembler := & Assembler { packet : sharedPacketPoolManager . Get ( ) . ( * Packet ) , sharedPacketPoolManager : sharedPacketPoolManager , packetsBuffer : packetsBuffer , flushTimer : time . NewTicker ( flushTimer ) , packetSourceType : packetSourceType , closeChannel : make ( chan struct { } ) , } go packetAssembler . flushLoop ( ) return packetAssembler }
NewAssembler creates a new Assembler instance using the specified flush duration, buffer and pool manager
NewAssembler creates a new Assembler instance using the specified flush duration buffer and pool manager
// retrieve an available packet from the packet pool, // which will be pushed back by the server when processed.