1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-06 20:16:59 +00:00

Added documentations for package handler

This commit is contained in:
diamondburned (Forefront) 2020-01-16 21:27:57 -08:00
parent deafe15967
commit 842daaa957

View file

@ -1,3 +1,18 @@
// Package handler handles incoming Gateway events. It reflects the function's
// first argument and caches that for use in each event.
//
// Performance
//
// Each call to the event would take 156 ns/op for roughly each handler. Scaling
// that up to 100 handlers is multiplying 156 ns by 100, which gives 15600 ns,
// or 0.0156 ms.
//
// BenchmarkReflect-8 7260909 156 ns/op
//
// Usage
//
// s.AddHandler(func(m *gateway.MessageCreateEvent) {})
//
package handler
import (