<commit_before>// Copyright 2012 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package pubsub

import (
	"time"
)

// Message is the container for whatever data is being published.
type Message struct {
	OneLine   [70]byte
	TimeStamp time.Time
	FullText  string
}

// Filters are an identifiable interface used to specify
// what results a Publisher should send over a channel
type Filter interface {
	Identify() string
}

// Publishers are identifiable sources of new information.
// We only care that they provide a channel for receiving
// Messages to send to Subscribers and a channel to send
// a signal to stop sending Messages.
//
// The value sent over the boolean channel should not
// matter, though it will be true. The act of sending
// over the channel is a request to stop sending Messages.
type Publisher interface {
	Publish(Filter) (<-chan Message, chan<- bool, error)
	Identify() string
}<commit_msg>Add Subscriber interface<commit_after>// Copyright 2012 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package pubsub

import (
	"time"
)

// Message is the container for whatever data is being published.
type Message struct {
	OneLine   [70]byte
	TimeStamp time.Time
	FullText  string
}

// Filters are an identifiable interface used to specify
// what results a Publisher should send over a channel
type Filter interface {
	Identify() string
}

// Publishers are identifiable sources of new information.
// We only care that they provide a channel for receiving
// Messages to send to Subscribers and a channel to send
// a signal to stop sending Messages.
//
// The value sent over the boolean channel should not
// matter, though it will be true. The act of sending
// over the channel is a request to stop sending Messages.
type Publisher interface {
	Publish(Filter) (<-chan Message, chan<- bool, error)
	Identify() string
}

// Subscribers are identifiable recipients of new information.
// We only care that they provide a channel for sending
// Messages from Publishers and a channel to receive a signal
// to stop sending Messages.
//
// The value sent over the boolean channel does not matter.
// The act of sending a value over the channel is a request
// to stop sending Messages.
type Subscriber interface {
	Subscribe() (chan<- Message, <-chan bool, error)
	Identify() string
}
{'fraction_non_alphanumeric': 0.07002012072434607, 'fraction_numerical': 0.00482897384305835, 'mean_word_length': 3.5698529411764706, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, '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': '2159814', 'n_tokens_mistral': 668, 'n_tokens_neox': 638, 'n_words': 358}