Skip to content

Remove lifetime parameter from Worker #99

@vbkaisetsu

Description

@vbkaisetsu

Currently, the Worker struct is defined as follows:

struct Worker<'a> {
    ...
}

where 'a is a lifetime parameter of the Tokenizer. By this definition, the Worker can refer to the Tokenizer automatically for every tokenization.

This definition causes a problem when creating wrappers for other programming languages that use garbage collectors (GC).
The above definition means that the Tokenizer cannot be removed when the Worker is alive, but there is no way to impose this constraint on the GC.

To solve this problem, we need to remove the lifetime parameter and give the Worker struct to the Tokenizer for every tokenization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions