<commit_before>import { HedgehogClient, Message, analog, digital } from 'hedgehog-client';

export default class SocketIoSensorAdapter {
    private ns: SocketIO.Namespace;
    private requests: Message[] = [];

    public constructor (private hedgehog: HedgehogClient, io: SocketIO.Server) {
        this.ns = io.of('/sensors');
        for (let port = 0; port < 16; port++) {
            this.requests.push(new analog.Request(port), new digital.Request(port));
        }
        setInterval(async () => this.sendSensorUpdate(), 200);
    }

    private async sendSensorUpdate () {
        let sensorData: Array<{id: number, value: number, type: string}> = [];
        for (let reply of await this.hedgehog.sendMultipart(...this.requests)) {<commit_msg>increase timeout for sensor updates<commit_after>import { HedgehogClient, Message, analog, digital } from 'hedgehog-client';

export default class SocketIoSensorAdapter {
    private ns: SocketIO.Namespace;
    private requests: Message[] = [];

    public constructor (private hedgehog: HedgehogClient, io: SocketIO.Server) {
        this.ns = io.of('/sensors');
        for (let port = 0; port < 16; port++) {
            this.requests.push(new analog.Request(port), new digital.Request(port));
        }
        setInterval(async () => this.sendSensorUpdate(), 500);
    }

    private async sendSensorUpdate () {
        let sensorData: Array<{id: number, value: number, type: string}> = [];
        for (let reply of await this.hedgehog.sendMultipart(...this.requests)) {
{'fraction_non_alphanumeric': 0.13202614379084968, 'fraction_numerical': 0.00784313725490196, 'mean_word_length': 3.312676056338028, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2759696', 'n_tokens_mistral': 459, 'n_tokens_neox': 433, 'n_words': 118}