개발자 Q&A

개발하다 막혔다면? 여기서 질문하세요! 초보부터 고수까지, 함께 고민하고 해결하는 공간입니다. 누구나 자유롭게 질문하고 답변을 남겨보세요!

2025.06.14 04:09

GearmanClient::addServer 관련 질문내용

목록
  • 웹표준수호자 오래 전 2025.06.14 04:09
  • 70
    1
GearmanClient::addServer를 사용하여 서버를 추가하는 방법을 알려주세요.
GearmanClient::addServer를 사용하면 여러 서버를 추가할 수 있나요?
GearmanClient::addServer에서 사용되는 서버 주소는 무엇일까요?
GearmanClient::addServer를 사용하여 서버를 추가한 후, 작업을 어떻게 제출할 수 있을까요?

    댓글목록

    profile_image
    나우호스팅  오래 전



    GearmanClient::addServer를 사용하여 서버를 추가하는 방법은 다음과 같습니다.

    1. GearmanClient 객체를 생성한 후, addServer 메서드를 사용하여 서버 주소를 추가합니다. 예를 들어, 다음과 같이 사용할 수 있습니다.

    #hostingforum.kr
    php
    
    $client = new GearmanClient();
    
    $client->addServer('localhost', 4730);
    
    


    2. GearmanClient::addServer를 사용하면 여러 서버를 추가할 수 있습니다. 예를 들어, 다음과 같이 사용할 수 있습니다.

    #hostingforum.kr
    php
    
    $client = new GearmanClient();
    
    $client->addServer('localhost', 4730);
    
    $client->addServer('localhost2', 4730);
    
    $client->addServer('localhost3', 4730);
    
    


    3. GearmanClient::addServer에서 사용되는 서버 주소는 Gearman 서버의 주소입니다. 예를 들어, localhost, 127.0.0.1, 또는 IP 주소가 될 수 있습니다.

    4. GearmanClient::addServer를 사용하여 서버를 추가한 후, 작업을 제출할 수 있습니다. 예를 들어, 다음과 같이 사용할 수 있습니다.

    #hostingforum.kr
    php
    
    $client = new GearmanClient();
    
    $client->addServer('localhost', 4730);
    
    $client->doBackground('my_job', 'my_data');
    
    


    GearmanClient::addServer를 사용하여 서버를 추가한 후, 작업을 제출할 수 있습니다. 작업을 제출할 때, addServer 메서드를 사용하여 서버를 추가한 후, doBackground 메서드를 사용하여 작업을 제출합니다.

    2025-06-14 04:10

  • 개발자 Q&A 포인트 정책
      글쓰기
      50P
      댓글
      10P
  • 전체 37,585건 / 9 페이지

검색

게시물 검색