Skip to content

RFC: support pass unique key to Keeper #25

@Ehco1996

Description

@Ehco1996

Hi, first of all thank you for the library!

In the process of trying to use it, we found that because the worker's unique id is achieved through sonyflake, the worker requires an integer between 0 and 255 to achieve the unique id when it is started

func CheckWorkerKey(key string) (int, error) {

In practice, this restriction would lead to reliance on external storage to generate the unique integer in multi-process situations, so I propose that the global unique key can be passed directly from the caller and the keeper component no longer generates the unique key based on number

There are two advantages to this change

  • the logic of the keeper component is lighter, no need to generate its own unique keys, no need to introduce sonyflake
  • the limit of less than 255 workers is lifted

If you agree to this change, I will provide PR in my free time

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions