You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
naza/pkg/defertaskthread/interface.go

22 lines
615 B
Go

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// Copyright 2020, Chef. All rights reserved.
// https://github.com/q191201771/naza
//
// Use of this source code is governed by a MIT-style license
// that can be found in the License file.
//
// Author: Chef (191201771@qq.com)
package defertaskthread
type TaskFn func(param ...interface{})
type DeferTaskThread interface {
// 注意一个thread的多个task本应该是串行执行的语义
// 目前为了简单,让它们并行执行了,以后可能会发生变化
Go(deferMs int, task TaskFn, param ...interface{})
}
func NewDeferTaskThread() DeferTaskThread {
return &deferTaskThread{}
}