<commit_before>package cache

type SubscriptionInterface interface {
	Each(f func(item interface{}) bool) error
	Subscribe(routingKeyPrefix string) error
	Unsubscribe(routingKeyPrefix string) error
	Has(routingKeyPrefix string) (bool, error)
	Len() (int, error)
	Resubscribe(socketID string) (bool, error)
	ClearWithTimeout() error
}

type SubscriptionStorage struct {
	storage SubscriptionInterface
}

func NewStorage(cacheType, socketID string) (*SubscriptionStorage, error) {

	var err error
	var be SubscriptionInterface

	switch cacheType {
	case "redis":
		be, err = NewRedis(socketID)
	default:
		be, err = NewSubscriptionSet(socketID)
	}

	if err != nil {
		return nil, err
	}
<commit_msg>Broker: change naming for interface<commit_after>package cache

type Subscriptionable interface {
	Each(f func(item interface{}) bool) error
	Subscribe(routingKeyPrefix string) error
	Unsubscribe(routingKeyPrefix string) error
	Has(routingKeyPrefix string) (bool, error)
	Len() (int, error)
	Resubscribe(socketID string) (bool, error)
	ClearWithTimeout() error
}

type SubscriptionStorage struct {
	storage Subscriptionable
}

func NewStorage(cacheType, socketID string) (*SubscriptionStorage, error) {

	var err error
	var be Subscriptionable

	switch cacheType {
	case "redis":
		be, err = NewRedis(socketID)
	default:
		be, err = NewSubscriptionSet(socketID)
	}

	if err != nil {
		return nil, err
	}

{'fraction_non_alphanumeric': 0.08779443254817987, 'fraction_numerical': 0.0, 'mean_word_length': 5.644549763033176, 'pattern_counts': {'":': 2, '<': 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': '6185501', 'n_tokens_mistral': 442, 'n_tokens_neox': 438, 'n_words': 130}