Sobes.tech

Did you decide to write a WaitGroup because you got a channel or goroutines for some reason?

Senior
172

What does the Go convention say about using WaitGroup and return types (accept interfaces, return concrete types)?

Senior
172

Do you have any questions for me?

Senior
171

In a worker goroutine, can you describe what you use to read from the channel?

Senior
170

Can a goroutine write directly to another goroutine with a buffered channel?

Senior
168

Do you want to write a classic worker pool?

Senior
166

What technology/tool do you use?

Senior
166

What index types are used in PostgreSQL besides B-tree?

Senior
165

What was your role in making architectural decisions when developing the search service?

Senior
164

// The client passes an object (Task) with data for executing a task, // in our example, we will use an empty structure. // // The handler can process no more than N tasks simultaneously, // and no more than X tasks can be queued for processing. // If there is no space in the queue, immediately return an error to the client. // // A task is taken for processing if there are free handlers available. // We simulate processing duration with time.Sleep(5*time.Second). // As soon as one task is completed, we take the next task from the queue. // If the queue is empty, we wait for new tasks from clients. // // With a star: extend the Task structure and get task statuses through a separate request package scheduler type Scheduler interface { AddTask(t Task) error Close() } type scheduler struct { queue chan Task wg sync.WaitGroup } func New(workers, queue int) Scheduler { } type Task interface { Do() }

Senior
164

func New(workers, queue, int) Scheduler { s := &scheduler { queue := make(chan Task, queue) for i := 0; i < workers; i++ { wg.Add(1) go func() { defer wg.Done() for task := range s.queue { task.Do() } }() } } return s } func (s *scheduler) Close() { close(s.queue) s.wg.Wait() } type Task interface { Do() }

Senior
163

Have you used CTE? Tell me what it is.

Senior
162

If we want to handle errors occurring in tasks externally, how could we do it?

Senior
161

Have you used contexts in practice? Tell us.

Senior
161

Is work only permitted within the territory of the Russian Federation?

Senior
160

What is the difference between SELECT FOR UPDATE and SELECT FOR SHARE?

Senior
159

Is it possible to create an index only on a replica, but not on the master?

Senior
159

Are there still data races in the implementation? Specifically in the Keys method that returns a slice of keys?

Senior
158

Types of replication in PostgreSQL

Senior
156

Do you have experience writing Kubernetes operators, managing operators, Helm Charts?

Senior
155
/7