Árvore de páginas

Destrói a Fila

Sintaxe

 

nRet := oTQLS:Destroy( )

Parâmetros

NomeTipoDescriçãoObrigatórioReferênciaObservações

Retorno

NomeTipoDescriçãoObservações
nRet 
Numérico

se executou corretamente retorna 0 ("OK"), caso contrário contem o número do erro

 

Observações

Exemplos

Exemplo 

Destroy
#include 'protheus.ch'

// Setup Redis
Static cRedisHost := "tec-clima"
Static nRedisPort := 6379


User Function FilRem()
  Local nRet       := 0
  // Nome da Fila
  Local cQueueName := "Fila_TQLS"
  // Objeto de Fila
  Local oTQLS := Nil
  // Cria um novo objeto de Fila
  oTQLS := TQueueSvc():New(cQueueName)
  If(oTQLS == Nil)
    ConOut("### ERRO ### " + "Erro na criacao da Fila - " + cQueueName)
    Return .F.
  Else
    ConOut("Criacao da Fila  OK - " + oTQLS:cName)
  EndIf
  // Configurando a Fila
  nRet := oTQLS:Setup(cRedisHost, nRedisPort)
  If nRet != 0
    ConOut("### ERRO ### " + "Erro ao fazer o Setup" + " Erro: " + AllTrim(Str(nRet)))
    Return .F.
  Else
    ConOut("Setup de Fila    OK - " + oTQLS:cName + " nMsgRetPer: " + AllTrim(Str(oTQLS:nMsgRetPer)) + " nVisTimeOut: " + AllTrim(Str(oTQLS:nVisTimeOut)))
  EndIf
  // Destruindo a Fila
  nRet := oTQLS:Destroy( )
  If nRet != 0
    ConOut("### ERRO ### " + "Erro ao destruir a Fila " + " Erro: " + AllTrim(Str(nRet)))
    Return .F.
  Else
    ConOut("Destruiu a Fila  OK - " + oTQLS:cName)
    Return .T.
  EndIf
Return .T.

Veja também

  • Sem rótulos