2

I'm trying using huawei tasks and faced a problem. How to create task that calls a specific method, that returns "void"? For example in c# i can:

    public static Task MyTask()
    {
        return Task.Factory.StartNew(() =>
        {
           //some logic here...(specific "void" method)
            
        });
    }

is there a way to do similar things with huawei.tasks?

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108

1 Answers1

0

From your description, you want to create a new thread to perform some operations. Huawei tasks are customized for asynchronous operations on Huawei interfaces. You could directly use the multi-thread interfaces provided by Java as follows:

        new Thread(new Runnable() {
            @Override
            public void run() {
                //some logic here...
            }
        }).start();
zhangxaochen
  • 32,744
  • 15
  • 77
  • 108