-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.go
36 lines (36 loc) · 921 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Package emitty is a simple event emitter. You can set an Event and Emit it as long as you want.
// Here is the basic example:
// defer func() {
// r := recover()
// if r != nil {
// fmt.Println("Panic Recovered", r)
// }
// }()
//
// fmt.Println("Emitty Simple Usage")
//
// signal := emitty.New(debug)
// listener := emitty.NewListener(&emitty.Config{
// Signal: signal,
// NumberOfWorkers: 3,
// })
// emitter := emitty.NewEmitter(signal)
//
// err := listener.AttachEvent(&emitty.Event{
// Name: "printStr",
// ActiveOn: time.Now().Add(time.Second * 0),
// Expiration: time.Second * 15,
// Handler: exampleHandler,
// MaxHits: 5,
// StartImmediately: true,
// })
// if err != nil {
// panic(err)
// }
//
// listener.Start()
//
// time.Sleep(time.Second * 3)
//
// emitter.Emit("printStr", "Hello World\n")
package emitty