JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • select: channel multiplexing and the default branch

    Go SELF
    67 level,0 lecture
    We break down the select construct in Go: how it picks a “ready” case based on the readiness of read/write operations on channels, why branch order does not provide priority, and how default turns waiting into a non-blocking attempt. In practice, we will assemble a mini event loop for the console app TaskBox, discuss closed channels ( ok == false), and show how to avoid falling into a busy loop with for { select { default : } }.
    Open
  • Timeouts via time.After / time.NewTimer

    Go SELF
    67 level,1 lecture
    We break down a basic (and very practical) timeout pattern in Go concurrency: add a timeout as one more event in select via time.After, and a controllable timer time.NewTimer. We’ll show timeouts for receive and send, move the waiting logic into a function, discuss the Stop() discipline, and common mistakes (trying to replace a timeout with time.Sleep, uncontrolled time.After in a “hot” loop, sender deadlock, and the false expectation that a timeout “cancels” the work of another goroutine).
    Open
  • Fan-out / Fan-in — dispatch work and collect results

    Go SELF
    67 level,2 lecture
    We break down two fundamental concurrency patterns in Go: how to “dispatch” independent tasks to goroutines ( fan-out) and how to “collect” results back into a single point ( fan-in). Using practical examples, we discuss channel buffering ( make(chan T, n)), the channel closing protocol ( close), stream merging via merge + sync.WaitGroup, and the “first result wins” pattern with select and default.
    Open
  • Cancellation via context in select: case <- ctx.Done()

    Go SELF
    67 level,3 lecture
    We break down a practical pattern for canceling concurrent operations in Go: how to use context.Context and the Done() channel in select so you do not hang “forever” on channel reads and writes. We will show templates for worker loops, cancelable result sending, and a “first urgent task” example with context.WithTimeout, and we will also go over common mistakes when using case <- ctx.Done().
    Open
  • Goroutine leaks: common causes and the “termination rule”

    Go SELF
    67 level,4 lecture
    We break down why goroutines “leak” in Go: blocking send/receive on channels, an infinite for range without close, timeouts without stopping workers, and select with default that turns code into a busy loop. We formulate the “termination rule”: every goroutine must have a guaranteed exit path—via closing a channel, a ctx.Done() signal, or a protocol that prevents indefinite blocking.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush