<commit_before>package asock // import "firepear.net/asock"

// Copyright (c) 2014,2015 <NAME> <<EMAIL>>. All
// rights reserved.  Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import (
	"net"
	"sync"
	"time"
)


// Message levels control which messages will be sent to as.Msgr
const (
	All = iota
	Conn
	Error
	Fatal
	Version = "0.11.0"
)

// Asock is a handle on an asock instance. It contains the
// Msgr channel, which is the conduit for notifications from the
// instance.
type Asock struct {
	Msgr chan *Msg
	q    chan bool
	w    *sync.WaitGroup
	s    string       // socket name
	l    net.Listener // listener socket
	d    Dispatch     // dispatch table
	t    int          // timeout
	ml   int          // message level
}

// Config holds values to be passed to the constuctor.
//
// For Unix sockets, Sockname takes the form "/path/to/socket". For
// TCP socks, it is either an IPv4 or IPv6 address followed by the
// desired port number ("127.0.0.1:9090", "[::1]:9090").
//
// Timeout is the number of seconds the socket will wait before timing
// out due to inactivity. Set it to zero for no timeout. Set to a
// negative value for a connection which closes after handling one
// request — so a timeout of -3 gives a connection which closes after
// one request or 3 seconds, whichever happens first.
//
// Msglvl determines which messages will be sent to the socket's
// message channel. Valid values are asock.All, asock.Conn,
// asock.Error, and asock.Fatal.
type Config struct {
	Sockname string
	Timeout  int
	Msglvl   int
}

// Dispatch is the dispatch table which drives asock's behavior. See
// the package Overview for more info on this and DispatchFunc.
type Dispatch map[string]*DispatchFunc
<commit_msg>one more doc tweak<commit_after>package asock // import "firepear.net/asock"

// Copyright (c) 2014,2015 <NAME> <<EMAIL>>. All
// rights reserved.  Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import (
	"net"
	"sync"
	"time"
)


// Message levels control which messages will be sent to as.Msgr
const (
	All = iota
	Conn
	Error
	Fatal
	Version = "0.11.0"
)

// Asock is a handle on an asock instance. It contains the
// Msgr channel, which is the conduit for notifications from the
// instance.
type Asock struct {
	Msgr chan *Msg
	q    chan bool
	w    *sync.WaitGroup
	s    string       // socket name
	l    net.Listener // listener socket
	d    Dispatch     // dispatch table
	t    int          // timeout
	ml   int          // message level
}

// Config holds values to be passed to the constuctor.
//
// For Unix sockets, Sockname takes the form "/path/to/socket". For
// TCP socks, it is either an IPv4 or IPv6 address followed by the
// desired port number ("127.0.0.1:9090", "[::1]:9090").
//
// Timeout is the number of seconds the socket will wait before timing
// out due to inactivity. Set it to zero for no timeout. Set to a
// negative value for a connection which closes after handling one
// request — so a timeout of -3 gives a connection which closes after
// one request or a read wait of 3 seconds, whichever happens first.
//
// Msglvl determines which messages will be sent to the socket's
// message channel. Valid values are asock.All, asock.Conn,
// asock.Error, and asock.Fatal.
type Config struct {
	Sockname string
	Timeout  int
	Msglvl   int
}

// Dispatch is the dispatch table which drives asock's behavior. See
// the package Overview for more info on this and DispatchFunc.
type Dispatch map[string]*DispatchFunc

{'fraction_non_alphanumeric': 0.08710217755443886, 'fraction_numerical': 0.017308766052484645, 'mean_word_length': 2.8444206008583692, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1228481', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1047, 'n_words': 507}