Skip to content
Snippets Groups Projects
Select Git revision
  • dfdeee43fc1a84585d47e939dd4aed9c3da844a7
  • without_tipselection default
  • develop protected
  • fix/grafana-local-dashboard
  • wasp
  • fix/dashboard-explorer-freeze
  • master
  • feat/timerqueue
  • test/sync_debug_and_650
  • feat/sync_revamp_inv
  • wip/sync
  • tool/db-recovery
  • portcheck/fix
  • fix/synchronization
  • feat/new-dashboard-analysis
  • feat/refactored-analysis-dashboard
  • feat/new-analysis-dashboard
  • test/demo-prometheus-fpc
  • prometheus_metrics
  • wip/analysis-server
  • merge/fpc-test-value-transfer
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
28 results

plugin.go

Blame
  • event.go 633 B
    package events
    
    type Event struct {
    	triggerFunc func(handler interface{}, params ...interface{})
    	callbacks   map[uintptr]interface{}
    }
    
    func (this *Event) Attach(closure *Closure) {
    	this.callbacks[closure.Id] = closure.Fnc
    }
    
    func (this *Event) Detach(closure *Closure) {
    	delete(this.callbacks, closure.Id)
    }
    
    func (this *Event) Trigger(params ...interface{}) {
    	for _, handler := range this.callbacks {
    		this.triggerFunc(handler, params...)
    	}
    }
    
    func NewEvent(triggerFunc func(handler interface{}, params ...interface{})) *Event {
    	return &Event{
    		triggerFunc: triggerFunc,
    		callbacks:   make(map[uintptr]interface{}),
    	}
    }