Skip to content

API breaking changes proposal #77

@frewsxcv

Description

@frewsxcv
  • add struct ThreadPoolBuilder

  • add ThreadPoolBuilder fn new()
    • uses num_cpu crate to default num of threads to num of cpus

  • remove: ThreadPool fn new(num_threads: usize) -> ThreadPool
  • add: ThreadPool fn new() -> ThreadPool
    • uses num_cpu to default num of threads to num of cpus
  • add: ThreadPoolBuilder fn num_threads(self, num: usize) -> ThreadPoolBuilder
    • set the number of threads for the pool that the builder will construct

  • remove: ThreadPool fn with_name(name: String, num_threads: usize) -> ThreadPool
  • add: ThreadPoolBuilder fn name(self, name: String) -> ThreadPoolBuilder


In summary: remove all constructors off of ThreadPool, except a new new constructor. If you want to fine-tune your threadpool, you'd use a ThreadPoolBuilder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.0Currently planed for 2.0

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions