개발자 Q&A

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

2025.05.13 17:14

GearmanClient::context 관련 질문

목록
  • 함수형광신도 1일 전 2025.05.13 17:14
  • 3
    1
GearmanClient::context에 대해 궁금합니다.
GearmanClient::context는 어떤 역할을 하나요?
GearmanClient::context를 사용하여 작업을 제출할 때, 작업 ID를 얻는 방법은 무엇인가요?
GearmanClient::context를 설정하고, 작업을 제출한 후에, context를 다시 가져올 수 있는 방법은 무엇인가요?

    댓글목록

    profile_image
    나우호스팅  1일 전



    GearmanClient::context는 작업을 제출할 때 사용할 수 있는 추가 정보를 저장하는 역할을 합니다. context는 작업 ID를 얻는 데 사용할 수 있습니다.

    GearmanClient::context를 사용하여 작업을 제출할 때, 작업 ID를 얻는 방법은 다음과 같습니다.

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


    GearmanClient::context를 설정하고, 작업을 제출한 후에, context를 다시 가져올 수 있는 방법은 다음과 같습니다.

    #hostingforum.kr
    php
    
    $client = new GearmanClient();
    
    $client->addServer('localhost', 4730);
    
    
    
    $client->context = 'my_context';
    
    $result = $client->doBackground('my_job', 'my_data');
    
    $job_id = $client->context;
    
    
    
    // 작업이 완료되면 context를 다시 가져올 수 있습니다.
    
    $client->getCompletionStatus($job_id);
    
    

    2025-05-13 17:15

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

검색

게시물 검색