php_gearman_worker.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Gearman PHP Extension
  3. *
  4. * Copyright (C) 2008 James M. Luedke <contact@jamesluedke.com>,
  5. * Eric Day <eday@oddments.org>
  6. * All rights reserved.
  7. *
  8. * Use and distribution licensed under the PHP license. See
  9. * the LICENSE file in this directory for full text.
  10. */
  11. #ifndef __PHP_GEARMAN_WORKER_H
  12. #define __PHP_GEARMAN_WORKER_H
  13. #include "php.h"
  14. #include "php_ini.h"
  15. #include "ext/standard/info.h"
  16. #include "zend_exceptions.h"
  17. #include "zend_interfaces.h"
  18. #include "php_gearman.h"
  19. #include "php_gearman_job.h"
  20. #include "php_gearman_client.h"
  21. #include <libgearman-1.0/gearman.h>
  22. #include <libgearman-1.0/interface/status.h>
  23. #include <libgearman-1.0/status.h>
  24. extern zend_class_entry *gearman_worker_ce;
  25. extern zend_object_handlers gearman_worker_obj_handlers;
  26. zend_object *gearman_worker_obj_new(zend_class_entry *ce);
  27. typedef struct {
  28. zval zname; /* name associated with callback */
  29. zval zcall; /* name of callback */
  30. zval zdata; /* data passed to callback via worker */
  31. } gearman_worker_cb_obj;
  32. typedef enum {
  33. GEARMAN_WORKER_OBJ_CREATED = (1 << 0)
  34. } gearman_worker_obj_flags_t;
  35. typedef struct {
  36. gearman_return_t ret;
  37. gearman_worker_obj_flags_t flags;
  38. gearman_worker_st worker;
  39. zval cb_list;
  40. zend_object std;
  41. } gearman_worker_obj;
  42. gearman_worker_obj *gearman_worker_fetch_object(zend_object *obj);
  43. #define Z_GEARMAN_WORKER_P(zv) gearman_worker_fetch_object(Z_OBJ_P((zv)))
  44. #endif /* __PHP_GEARMAN_WORKER_H */