package com.kiisoo.ic.synchronous.service;

import com.kiisoo.ic.common.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BackReceiveService extends AbstractMsgDisruptor{

    @Autowired
    private BackDisposeService backDisposeService;

    @Override
    public int getRingBufferSize() {
        return 1024;
    }

    @Override
    public AbstractMsgEventHandler[] getMsgEventHandle() {
        AbstractMsgEventHandler[] list = new AbstractMsgEventHandler[10];
        for(int i = 0; i < 10; i++){
            DisruptorConsume disruptorConsume = new DisruptorConsume();
            disruptorConsume.setDisruptorCallack(backDisposeService);
            list[i] =  disruptorConsume;
        }
        return list;
    }

    @Override
    public String getName() {
        return null;
    }
}
