<commit_before>package rabbitmq

import (
	"encoding/json"
	"errors"
	"sync"
	"time"

	log "github.com/Sirupsen/logrus"
	"github.com/streadway/amqp"
)

const QueueMaxPriority int16 = 255

type RabbitMQ struct {
	connection             *amqp.Connection
	channel                *amqp.Channel
	isOnline               bool
	errorCloseChan         chan *amqp.Error
	uri                    string
	queueName              string
	buffer                 chan interface{}
	reconnectWatchers      []chan *error
	reconnectWatchersMutex *sync.Mutex
}

func NewRabbitMQ(uri string, queueName string) *RabbitMQ {
	rabbit := RabbitMQ{
		isOnline:  false,
		uri:       uri,
		queueName: queueName,
	}
	rabbit.buffer = make(chan interface{})
	rabbit.errorCloseChan = make(chan *amqp.Error)
	rabbit.reconnectWatchers = make([]chan *error, 0)<commit_msg>reinvent rabbit<commit_after>package rabbitmq

import (
	"encoding/json"
	"errors"
	"sync"
	"time"

	log "github.com/Sirupsen/logrus"
	"github.com/streadway/amqp"
)

const QueueMaxPriority int16 = 255

type RabbitMQ struct {
	connection             *amqp.Connection
	channel                *amqp.Channel
	isOnline               bool
	errorCloseChan         chan *amqp.Error
	uri                    string
	queueName              string
	buffer                 chan interface{}
	reconnectWatchers      []chan *error
	reconnectWatchersMutex *sync.Mutex
}

func NewRabbitMQ(uri string, queueName string) *RabbitMQ {
	rabbit := RabbitMQ{
		isOnline:  false,
		uri:       uri,
		queueName: queueName,
	}
	// без этого поытка добавить еще одно событие в буфер вешает реквест
	rabbit.buffer = make(chan interface{}, 1000)
	rabbit.errorCloseChan = make(chan *amqp.Error)
	rabbit.reconnectWatchers = make([]chan *error, 0)
{'fraction_non_alphanumeric': 0.08752860411899313, 'fraction_numerical': 0.009153318077803204, 'mean_word_length': 2.705508474576271, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2808074', 'n_tokens_mistral': 624, 'n_tokens_neox': 566, 'n_words': 136}