github.com/turingchain2020/turingchain@v1.1.21/cmd/tools/tasks/taskbase.go (about)

     1  // Copyright Turing Corp. 2018 All Rights Reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package tasks
     6  
     7  import "github.com/turingchain2020/turingchain/common/log/log15"
     8  
     9  var (
    10  	mlog = log15.New("module", "task")
    11  )
    12  
    13  //TaskBase task base
    14  type TaskBase struct {
    15  	NextTask Task
    16  }
    17  
    18  //Execute 执行
    19  func (t *TaskBase) Execute() error {
    20  	return nil
    21  }
    22  
    23  //SetNext set next
    24  func (t *TaskBase) SetNext(task Task) {
    25  	t.NextTask = task
    26  }
    27  
    28  //Next 获取next
    29  func (t *TaskBase) Next() Task {
    30  	return t.NextTask
    31  }