github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/timer/timer-callback.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package timer
     4  
     5  type callback func(arg any)
     6  
     7  func (c callback) concurrentRun(arg any) {
     8  	go c(arg)
     9  }
    10  
    11  // NotifyChannel does a non-blocking send the signal on t.signal
    12  func notifyTimerChannel(t any) {
    13  	select {
    14  	case t.(*Timer).signal <- struct{}{}:
    15  	default:
    16  	}
    17  }