Skip to content

Blocking Reads? #4

@MarcMagnin

Description

@MarcMagnin

Hey,

I wanted to replace a worker/dispatcher logic orchestrated with channels with this but I notice a high CPU usage so the lib is probably not adapted for such usage.
I'd like the have workers waiting for more work to process such as:

 for {
        work := gringo.Read()
        // ... process the work
    }

but if I understand it well, it'll release the thread and continue to loop, hence a 100% CPU usage.
Can you think of a way to block instead, waiting for more work to process?
Many 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