mirror of
				https://github.com/oarkflow/mq.git
				synced 2025-10-31 15:06:20 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			301 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			301 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package main
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 
 | |
| 	"github.com/oarkflow/mq"
 | |
| 	"github.com/oarkflow/mq/examples/tasks"
 | |
| )
 | |
| 
 | |
| func main() {
 | |
| 	consumer := mq.NewConsumer("consumer-1")
 | |
| 	consumer.RegisterHandler("queue1", tasks.Node1)
 | |
| 	consumer.RegisterHandler("queue2", tasks.Node2)
 | |
| 	consumer.Consume(context.Background())
 | |
| }
 | 
