【问题标题】:I need help in applying multi-threading to groovy class我需要帮助将多线程应用于 groovy 类
【发布时间】:2020-09-07 05:21:08
【问题描述】:

我有一个 groovy 类会产生问题,但是当我需要创建超过 2 个问题时,我会遇到性能问题,这就是为什么我想使用线程来获得更好的性能。

这是我的代码示例。请帮我在这段代码中添加多线程(我想将多线程应用到static void main part):

import // some libraries
class NotificationIssue
{
   NotificationIssue()
  {
  //Some codes
  }

  def getCustomFieldsValues (issueid)
  {
  //Some codes
  }

  def Check3cxPhone()
  {
  //Some codes
  }
  def CheckNetworkFolder()
  {
  //Some codes
  }

  def setIQLFacadeAndObjectFacade()
  {
  //Some codes
  }

  def CheckServerSystemAndUserAccount()
  {
   //Some codes
   }

  def CheckService()
  {
  //Some codes
  }

  def setIssueInputParameter()
  {
  //Some codes
  }
}

public static void main(String[] args)
{

//1st Notification issue for IT
NotificationIssue NotificationForIT = new NotificationIssue()
def key1 = NotificationForIT.getCustomFieldsValues(issue.key)
NotificationForIT.setIQLFacadeAndObjectFacade()
NotificationForIT.Check3cxPhone()
NotificationForIT.CheckNetworkFolder()
NotificationForIT.CheckServerSystemAndUserAccount()
NotificationForIT.CheckService()
NotificationForIT.setIssueInputParameter(customerRtype, "Notification Issue-", issueType, user,"SD",10200)

//2nd Notification for another department
NotificationIssue StampNotification = new NotificationIssue()
def key2 = StampNotification.getCustomFieldsValues(issue.key)
StampNotification.setIQLFacadeAndObjectFacade()


//3rd Notification issue for...
...
}

【问题讨论】:

    标签: multithreading groovy jira


    【解决方案1】:

    我是使用 thread.start() 和 thread.join() 完成的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多