├── NEWS ├── docker ├── example │ ├── gearmand │ │ ├── .dockerignore │ │ ├── gearmand.conf │ │ └── Makefile │ └── supervisord │ │ ├── .dockerignore │ │ ├── Makefile │ │ ├── supervisord.conf │ │ └── Dockerfile ├── testing │ ├── alpine │ │ ├── 3.12 │ │ │ ├── .dockerignore │ │ │ ├── Makefile │ │ │ └── Dockerfile │ │ └── 3.13 │ │ │ ├── .dockerignore │ │ │ ├── Makefile │ │ │ └── Dockerfile │ ├── centos │ │ ├── 7 │ │ │ ├── .dockerignore │ │ │ ├── Makefile │ │ │ └── Dockerfile │ │ └── 7-32bit │ │ │ ├── .dockerignore │ │ │ ├── Makefile │ │ │ └── Dockerfile │ ├── fedora │ │ ├── 32 │ │ │ ├── .dockerignore │ │ │ ├── Makefile │ │ │ └── Dockerfile │ │ └── 36 │ │ │ ├── .dockerignore │ │ │ ├── Makefile │ │ │ └── Dockerfile │ └── ubuntu │ │ ├── 14.04 │ │ ├── .dockerignore │ │ ├── Makefile │ │ └── Dockerfile │ │ ├── 16.04 │ │ ├── .dockerignore │ │ ├── Makefile │ │ └── Dockerfile │ │ ├── 18.04 │ │ ├── .dockerignore │ │ ├── Makefile │ │ └── Dockerfile │ │ └── 20.04 │ │ ├── .dockerignore │ │ ├── Makefile │ │ └── Dockerfile └── README-Docker.md ├── THANKS ├── support ├── gearmand.sysconfig ├── gearmand.pc.in └── include.am ├── version.m4 ├── docs ├── source │ ├── architecture.rst │ ├── cc-symbol.png │ ├── changes.rst │ ├── libgearman │ │ ├── errors │ │ │ ├── GEARMAN_PIPE_EOF.rst │ │ │ ├── GEARMAN_ERRNO.rst │ │ │ ├── GEARMAN_FAIL.rst │ │ │ ├── GEARMAN_ERROR.rst │ │ │ ├── GEARMAN_NO_JOBS.rst │ │ │ ├── GEARMAN_SUCCESS.rst │ │ │ ├── GEARMAN_TIMEOUT.rst │ │ │ ├── GEARMAN_WORK_DATA.rst │ │ │ ├── GEARMAN_WORK_FAIL.rst │ │ │ ├── GEARMAN_FLUSH_DATA.rst │ │ │ ├── GEARMAN_JOB_EXISTS.rst │ │ │ ├── GEARMAN_NO_SERVERS.rst │ │ │ ├── GEARMAN_WORK_ERROR.rst │ │ │ ├── GEARMAN_GETADDRINFO.rst │ │ │ ├── GEARMAN_WORK_STATUS.rst │ │ │ ├── GEARMAN_IN_PROGRESS.rst │ │ │ ├── GEARMAN_JOB_QUEUE_FULL.rst │ │ │ ├── GEARMAN_MAX_RETURN.rst │ │ │ ├── GEARMAN_NOT_FLUSHING.rst │ │ │ ├── GEARMAN_SERVER_ERROR.rst │ │ │ ├── GEARMAN_WORK_WARNING.rst │ │ │ ├── GEARMAN_IGNORE_PACKET.rst │ │ │ ├── GEARMAN_INVALID_MAGIC.rst │ │ │ ├── GEARMAN_NOT_CONNECTED.rst │ │ │ ├── GEARMAN_NO_ACTIVE_FDS.rst │ │ │ ├── GEARMAN_TOO_MANY_ARGS.rst │ │ │ ├── GEARMAN_UNKNOWN_STATE.rst │ │ │ ├── GEARMAN_DATA_TOO_LARGE.rst │ │ │ ├── GEARMAN_INVALID_PACKET.rst │ │ │ ├── GEARMAN_UNKNOWN_OPTION.rst │ │ │ ├── GEARMAN_WORK_EXCEPTION.rst │ │ │ ├── GEARMAN_INVALID_COMMAND.rst │ │ │ ├── GEARMAN_LOST_CONNECTION.rst │ │ │ ├── GEARMAN_INVALID_ARGUMENT.rst │ │ │ ├── GEARMAN_NEED_WORKLOAD_FN.rst │ │ │ ├── GEARMAN_COULD_NOT_CONNECT.rst │ │ │ ├── GEARMAN_EVENT.rst │ │ │ ├── GEARMAN_UNEXPECTED_PACKET.rst │ │ │ ├── GEARMAN_ARGUMENT_TOO_LARGE.rst │ │ │ ├── GEARMAN_PTHREAD.rst │ │ │ ├── GEARMAN_SHUTDOWN.rst │ │ │ ├── GEARMAN_ECHO_DATA_CORRUPTION.rst │ │ │ ├── GEARMAN_FATAL.rst │ │ │ ├── GEARMAN_INVALID_FUNCTION_NAME.rst │ │ │ ├── GEARMAN_SEND_BUFFER_TOO_SMALL.rst │ │ │ ├── GEARMAN_NO_REGISTERED_FUNCTION.rst │ │ │ ├── GEARMAN_QUEUE_ERROR.rst │ │ │ ├── GEARMAN_INVALID_WORKER_FUNCTION.rst │ │ │ ├── GEARMAN_NO_REGISTERED_FUNCTIONS.rst │ │ │ ├── GEARMAN_MEMORY_ALLOCATION_FAILURE.rst │ │ │ ├── GEARMAN_RECV_IN_PROGRESS.rst │ │ │ ├── GEARMAN_SEND_IN_PROGRESS.rst │ │ │ ├── GEARMAN_SHUTDOWN_GRACEFUL.rst │ │ │ ├── GEARMAN_IO_WAIT.rst │ │ │ └── GEARMAN_PAUSE.rst │ │ ├── gearman_misc_functions.rst │ │ ├── types.rst │ │ ├── gearman_bugreport.rst │ │ ├── gearman_version.rst │ │ ├── gearman_string_t.rst │ │ ├── gearman_log_fn.rst │ │ ├── examples.rst │ │ ├── gearman_client_wait.rst │ │ ├── gearman_worker_set_identifier.rst │ │ ├── gearman_argument_t.rst │ │ ├── gearman_job_handle_t.rst │ │ ├── gearman_parse_servers.rst │ │ ├── examples │ │ │ ├── gearman_client_do_example.c │ │ │ ├── gearman_client_do_background_example.c │ │ │ ├── gearman_execute_partition.c │ │ │ └── gearman_execute_example.c │ │ ├── gearman_client_error.rst │ │ ├── gearman_worker_error.rst │ │ ├── namespace.rst │ │ ├── gearman_client_set_log_fn.rst │ │ ├── gearman_client_echo.rst │ │ ├── gearman_worker_set_log_fn.rst │ │ ├── gearman_task_attr_t.rst │ │ ├── gearman_client_run_tasks.rst │ │ ├── gearman_verbose_t.rst │ │ ├── gearman_allocator_t.rst │ │ ├── gearman_client_add_task_status.rst │ │ ├── gearman_worker_add_function.rst │ │ ├── gearman_client_add_server.rst │ │ ├── workers.rst │ │ ├── gearman_worker_add_server.rst │ │ └── gearman_worker_options.rst │ ├── protocol │ │ ├── gear.rst │ │ └── text.rst │ ├── how_to_report_a_bug.rst │ ├── gearmand │ │ ├── queues │ │ │ ├── sqlite.rst │ │ │ ├── drizzle.rst │ │ │ ├── postgres.rst │ │ │ └── mysql.rst │ │ ├── queues.rst │ │ └── ssl.rst │ ├── build │ │ ├── fedora.rst │ │ ├── ubuntu.rst │ │ └── centos5-8.rst │ ├── license.rst │ ├── install.rst │ ├── index.rst │ ├── glossary.rst │ └── bin │ │ └── gearadmin.rst └── include.am ├── .bootstrap ├── scripts ├── upstart │ ├── gearmand-init │ ├── gearman-job-server-monitor │ ├── gearman-job-server.conf │ └── german-job-server.override ├── travis-osx.sh ├── travis-linux.sh ├── README.solaris └── gearmand.in ├── m4 ├── README.md ├── include.am ├── drizzled.m4 ├── pandora_extensions.m4 ├── libdrizzle.m4 ├── pandora_clock_gettime.m4 ├── have_libpq.m4 ├── ax_print_to_file.m4 ├── hiredis.m4 ├── ax_append_to_file.m4 ├── ax_file_escapes.m4 ├── pandora_check_cxx_standard.m4 ├── pandora_with_r.m4 ├── ax_add_am_macro.m4 ├── ax_endian.m4 ├── ax_hex_version.m4 ├── pandora_stack_direction.m4 ├── pandora_use_pipe.m4 ├── fcntl_flags.m4 ├── ax_lib_curl.m4 ├── pandora_have_libtokyocabinet.m4 ├── pandora_have_gcc_atomics.m4 ├── ax_am_macros.m4 ├── pandora_with_python.m4 ├── pandora_with_python3.m4 ├── ax_pthread_timedjoin_np.m4 ├── ax_switch_flags.m4 └── bottom.m4 ├── .quickly ├── libboost ├── config │ └── workaround.hpp └── include.am ├── libtest ├── run-ci.gdb ├── run.gdb ├── yatl.m4 ├── m4 │ └── mysql.m4 ├── binaries.cc └── binaries.h ├── libgearman-server ├── error │ └── include.am ├── plugins │ ├── protocol │ │ ├── include.am │ │ ├── gear │ │ │ └── include.am │ │ └── http │ │ │ └── include.am │ ├── include.am │ └── queue │ │ ├── default │ │ └── include.am │ │ ├── redis │ │ └── include.am │ │ ├── tokyocabinet │ │ └── include.am │ │ ├── drizzle │ │ └── include.am │ │ ├── postgres │ │ └── include.am │ │ ├── libmemcached │ │ └── include.am │ │ ├── mysql │ │ └── include.am │ │ ├── sqlite │ │ └── include.am │ │ └── include.am └── struct │ └── include.am ├── tests ├── libgearman-1.0 │ └── 1077917.c ├── perl │ ├── include.am │ └── worker │ │ └── echo.pl ├── cpp_test.cc ├── redis.am ├── protocol.mk ├── tokyocabinet.am ├── mysql.am ├── httpd.am ├── postgres.am ├── stress.am ├── ephemeral.am ├── libmemcached.am ├── libdrizzle.am └── sqlite.am ├── AUTHORS ├── libhashkit ├── include.m4 ├── murmur3.h ├── behavior.cc ├── hashkit.h └── hashkitcon.h.in ├── libgearman-1.0 ├── t │ └── include.am └── include.am ├── util └── include.am ├── libhashkit-1.0 ├── include.am └── visibility.h ├── GNUmakefile ├── gearmand ├── connection.h └── server_common.h ├── COPYING ├── libhostile ├── sync.h ├── close.h ├── malloc.h ├── realloc.h ├── write.h ├── socket.h └── action.h ├── libgearman ├── string.cc ├── backtrace.hpp └── pipe.h └── examples └── include.am /NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docker/example/gearmand/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /docker/example/supervisord/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /docker/testing/alpine/3.12/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /docker/testing/alpine/3.13/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /docker/testing/centos/7/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /docker/testing/fedora/32/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /docker/testing/fedora/36/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- 1 | John Ewart, john@johnewart.net -- Epoch support 2 | -------------------------------------------------------------------------------- /docker/testing/centos/7-32bit/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/14.04/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/16.04/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/18.04/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/20.04/.dockerignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /support/gearmand.sysconfig: -------------------------------------------------------------------------------- 1 | ## Settings for gearmand 2 | #OPTIONS="" 3 | 4 | -------------------------------------------------------------------------------- /version.m4: -------------------------------------------------------------------------------- 1 | m4_define([VERSION_NUMBER], m4_esyscmd_s([git describe --always])) 2 | -------------------------------------------------------------------------------- /docs/source/architecture.rst: -------------------------------------------------------------------------------- 1 | Architecture 2 | ============ 3 | 4 | TTL 5 | 6 | TBD 7 | -------------------------------------------------------------------------------- /.bootstrap: -------------------------------------------------------------------------------- 1 | BOOTSTRAP_SNAPSHOT=true 2 | BOOTSTRAP_SNAPSHOT_CHECK="man/gearman_client_echo.3" 3 | -------------------------------------------------------------------------------- /docs/source/cc-symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gearman/gearmand/HEAD/docs/source/cc-symbol.png -------------------------------------------------------------------------------- /scripts/upstart/gearmand-init: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ln -s /lib/init/upstart-job /etc/init.d/gearman-job-server -------------------------------------------------------------------------------- /m4/README.md: -------------------------------------------------------------------------------- 1 | https://github.com/BrianAker/m4 2 | 3 | Common m4 files that I use. 4 | -Brian Aker, brian@tangent.org 5 | -------------------------------------------------------------------------------- /docs/source/changes.rst: -------------------------------------------------------------------------------- 1 | :tocdepth: 2 2 | 3 | .. _changes: 4 | 5 | Changelog 6 | ********* 7 | 8 | .. include:: ../../ChangeLog 9 | -------------------------------------------------------------------------------- /.quickly: -------------------------------------------------------------------------------- 1 | project = gearmand 2 | version = 0.4.2 3 | template = pandora-build 4 | project-type = application 5 | pandora-version = 0.176 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_PIPE_EOF.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | GEARMAN_PIPE_EOF 3 | ================ 4 | 5 | Server only error. 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_ERRNO.rst: -------------------------------------------------------------------------------- 1 | ============= 2 | GEARMAN_ERRNO 3 | ============= 4 | 5 | Please see :c:type:`GEARMAN_ERRNO` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_FAIL.rst: -------------------------------------------------------------------------------- 1 | ============= 2 | GEARMAN_FATAL 3 | ============= 4 | 5 | Please see :c:type:`GEARMAN_FATAL`. 6 | 7 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_ERROR.rst: -------------------------------------------------------------------------------- 1 | ============= 2 | GEARMAN_ERROR 3 | ============= 4 | 5 | Please see :c:type:`GEARMAN_ERROR` 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_NO_JOBS.rst: -------------------------------------------------------------------------------- 1 | =============== 2 | GEARMAN_NO_JOBS 3 | =============== 4 | 5 | Please see :c:type:`GEARMAN_NO_JOBS` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_SUCCESS.rst: -------------------------------------------------------------------------------- 1 | =============== 2 | GEARMAN_SUCCESS 3 | =============== 4 | 5 | Please see :c:type:`GEARMAN_SUCCESS` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_TIMEOUT.rst: -------------------------------------------------------------------------------- 1 | =============== 2 | GEARMAN_TIMEOUT 3 | =============== 4 | 5 | Please see :c:type:`GEARMAN_TIMEOUT` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_WORK_DATA.rst: -------------------------------------------------------------------------------- 1 | ================= 2 | GEARMAN_WORK_DATA 3 | ================= 4 | 5 | Please see :c:type:`GEARMAN_WORK_DATA` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_WORK_FAIL.rst: -------------------------------------------------------------------------------- 1 | ================= 2 | GEARMAN_WORK_FAIL 3 | ================= 4 | 5 | Please see :c:type:`GEARMAN_WORK_FAIL` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_FLUSH_DATA.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | GEARMAN_FLUSH_DATA 3 | ================== 4 | 5 | Please see :c:type:`GEARMAN_FLUSH_DATA` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_JOB_EXISTS.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | GEARMAN_JOB_EXISTS 3 | ================== 4 | 5 | Please see :c:type:`GEARMAN_JOB_EXISTS` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_NO_SERVERS.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | GEARMAN_NO_SERVERS 3 | ================== 4 | 5 | Please see :c:type:`GEARMAN_NO_SERVERS` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_WORK_ERROR.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | GEARMAN_WORK_ERROR 3 | ================== 4 | 5 | Please see :c:type:`GEARMAN_WORK_ERROR` 6 | -------------------------------------------------------------------------------- /libboost/config/workaround.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __clang_major__ 2 | #define __clang_major___WORKAROUND_GUARD 1 3 | #else 4 | #define __clang_major___WORKAROUND_GUARD 0 5 | #endif 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_GETADDRINFO.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | GEARMAN_GETADDRINFO 3 | =================== 4 | 5 | Please see :c:type:`GEARMAN_GETADDRINFO` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_WORK_STATUS.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | GEARMAN_WORK_STATUS 3 | =================== 4 | 5 | Please see :c:type:`GEARMAN_WORK_STATUS` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_IN_PROGRESS.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | GEARMAN_IN_PROGRESS 3 | =================== 4 | 5 | Please see :c:type:`GEARMAN_IN_PROGRESS` 6 | 7 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_JOB_QUEUE_FULL.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | GEARMAN_JOB_QUEUE_FULL 3 | ====================== 4 | 5 | This is a server only error code. 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_MAX_RETURN.rst: -------------------------------------------------------------------------------- 1 | 2 | ================== 3 | GEARMAN_MAX_RETURN 4 | ================== 5 | 6 | Please see :c:type:`GEARMAN_MAX_RETURN` 7 | 8 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_NOT_FLUSHING.rst: -------------------------------------------------------------------------------- 1 | ==================== 2 | GEARMAN_NOT_FLUSHING 3 | ==================== 4 | 5 | Please see :c:type:`GEARMAN_NOT_FLUSHING` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_SERVER_ERROR.rst: -------------------------------------------------------------------------------- 1 | ==================== 2 | GEARMAN_SERVER_ERROR 3 | ==================== 4 | 5 | Please see :c:type:`GEARMAN_SERVER_ERROR` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_WORK_WARNING.rst: -------------------------------------------------------------------------------- 1 | ==================== 2 | GEARMAN_WORK_WARNING 3 | ==================== 4 | 5 | Please see :c:type:`GEARMAN_WORK_WARNING` 6 | -------------------------------------------------------------------------------- /libtest/run-ci.gdb: -------------------------------------------------------------------------------- 1 | set logging on 2 | set logging overwrite on 3 | set environment LIBTEST_IN_GDB=1 4 | #set ASAN_OPTIONS=abort_on_error=1 5 | run 6 | thread apply all bt 7 | quit 8 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_IGNORE_PACKET.rst: -------------------------------------------------------------------------------- 1 | ===================== 2 | GEARMAN_IGNORE_PACKET 3 | ===================== 4 | 5 | Please see :c:type:`GEARMAN_IGNORE_PACKET` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_INVALID_MAGIC.rst: -------------------------------------------------------------------------------- 1 | ===================== 2 | GEARMAN_INVALID_MAGIC 3 | ===================== 4 | 5 | Please see :c:type:`GEARMAN_INVALID_MAGIC` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_NOT_CONNECTED.rst: -------------------------------------------------------------------------------- 1 | ===================== 2 | GEARMAN_NOT_CONNECTED 3 | ===================== 4 | 5 | Please see :c:type:`GEARMAN_NOT_CONNECTED` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_NO_ACTIVE_FDS.rst: -------------------------------------------------------------------------------- 1 | ===================== 2 | GEARMAN_NO_ACTIVE_FDS 3 | ===================== 4 | 5 | Please see :c:type:`GEARMAN_NO_ACTIVE_FDS` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_TOO_MANY_ARGS.rst: -------------------------------------------------------------------------------- 1 | ===================== 2 | GEARMAN_TOO_MANY_ARGS 3 | ===================== 4 | 5 | Please see :c:type:`GEARMAN_TOO_MANY_ARGS` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_UNKNOWN_STATE.rst: -------------------------------------------------------------------------------- 1 | ===================== 2 | GEARMAN_UNKNOWN_STATE 3 | ===================== 4 | 5 | Please see :c:type:`GEARMAN_UNKNOWN_STATE` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_DATA_TOO_LARGE.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | GEARMAN_DATA_TOO_LARGE 3 | ====================== 4 | 5 | Please see :c:type:`GEARMAN_DATA_TOO_LARGE` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_INVALID_PACKET.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | GEARMAN_INVALID_PACKET 3 | ====================== 4 | 5 | Please see :c:type:`GEARMAN_INVALID_PACKET` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_UNKNOWN_OPTION.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | GEARMAN_UNKNOWN_OPTION 3 | ====================== 4 | 5 | Please see :c:type:`GEARMAN_UNKNOWN_OPTION` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_WORK_EXCEPTION.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | GEARMAN_WORK_EXCEPTION 3 | ====================== 4 | 5 | Please see :c:type:`GEARMAN_WORK_EXCEPTION` 6 | -------------------------------------------------------------------------------- /libboost/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | noinst_HEADERS+= libboost/config/workaround.hpp 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_INVALID_COMMAND.rst: -------------------------------------------------------------------------------- 1 | ======================= 2 | GEARMAN_INVALID_COMMAND 3 | ======================= 4 | 5 | Please see :c:type:`GEARMAN_INVALID_COMMAND` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_LOST_CONNECTION.rst: -------------------------------------------------------------------------------- 1 | ======================= 2 | GEARMAN_LOST_CONNECTION 3 | ======================= 4 | 5 | Please see :c:type:`GEARMAN_LOST_CONNECTION` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_INVALID_ARGUMENT.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | GEARMAN_INVALID_ARGUMENT 3 | ======================== 4 | 5 | Please see :c:type:`GEARMAN_INVALID_ARGUMENT` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_NEED_WORKLOAD_FN.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | GEARMAN_NEED_WORKLOAD_FN 3 | ======================== 4 | 5 | Please see :c:type:`GEARMAN_NEED_WORKLOAD_FN` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_COULD_NOT_CONNECT.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | GEARMAN_COULD_NOT_CONNECT 3 | ========================= 4 | 5 | Please see :c:type:`GEARMAN_COULD_NOT_CONNECT` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_EVENT.rst: -------------------------------------------------------------------------------- 1 | ============= 2 | GEARMAN_EVENT 3 | ============= 4 | 5 | This is a server only related error, and will not be found in any client or 6 | worker return. 7 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_UNEXPECTED_PACKET.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | GEARMAN_UNEXPECTED_PACKET 3 | ========================= 4 | 5 | Please see :c:type:`GEARMAN_UNEXPECTED_PACKET` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_ARGUMENT_TOO_LARGE.rst: -------------------------------------------------------------------------------- 1 | ========================== 2 | GEARMAN_ARGUMENT_TOO_LARGE 3 | ========================== 4 | 5 | Please see :c:type:`GEARMAN_ARGUMENT_TOO_LARGE` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_PTHREAD.rst: -------------------------------------------------------------------------------- 1 | =============== 2 | GEARMAN_PTHREAD 3 | =============== 4 | 5 | This is a server only related error, and will not be found in any client or 6 | worker return. 7 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_SHUTDOWN.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | GEARMAN_SHUTDOWN 3 | ================ 4 | 5 | This is a server only related error, and will not be found in any client or 6 | worker return. 7 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_ECHO_DATA_CORRUPTION.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | GEARMAN_ECHO_DATA_CORRUPTION 3 | ============================ 4 | 5 | Please see :c:type:`GEARMAN_ECHO_DATA_CORRUPTION` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_FATAL.rst: -------------------------------------------------------------------------------- 1 | ============= 2 | GEARMAN_FATAL 3 | ============= 4 | 5 | Please see :c:type:`GEARMAN_FAIL`. :c:type:`GEARMAN_FATAL` has been deprecated, please use `GEARMAN_FAIL`. 6 | 7 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_INVALID_FUNCTION_NAME.rst: -------------------------------------------------------------------------------- 1 | ============================= 2 | GEARMAN_INVALID_FUNCTION_NAME 3 | ============================= 4 | 5 | Please see :c:type:`GEARMAN_INVALID_FUNCTION_NAME` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_SEND_BUFFER_TOO_SMALL.rst: -------------------------------------------------------------------------------- 1 | ============================= 2 | GEARMAN_SEND_BUFFER_TOO_SMALL 3 | ============================= 4 | 5 | Please see :c:type:`GEARMAN_SEND_BUFFER_TOO_SMALL` 6 | -------------------------------------------------------------------------------- /docs/source/protocol/gear.rst: -------------------------------------------------------------------------------- 1 | ================================= 2 | GEAR, The Gearman Binary Protocol 3 | ================================= 4 | 5 | See libgearman-1.0/protocol.h for specifics, or look on http://gearman.org/ 6 | -------------------------------------------------------------------------------- /scripts/travis-osx.sh: -------------------------------------------------------------------------------- 1 | #brew install boost 2 | wget https://bootstrap.pypa.io/get-pip.py 3 | sudo -H python get-pip.py 4 | sudo -H pip install virtualenv 5 | virtualenv sphinx 6 | . sphinx/bin/activate 7 | pip install sphinx 8 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_NO_REGISTERED_FUNCTION.rst: -------------------------------------------------------------------------------- 1 | ============================== 2 | GEARMAN_NO_REGISTERED_FUNCTION 3 | ============================== 4 | 5 | Please see :c:type:`GEARMAN_NO_REGISTERED_FUNCTION` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_QUEUE_ERROR.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | GEARMAN_QUEUE_ERROR 3 | =================== 4 | 5 | This is a server only related error, and will not be found in any client or 6 | worker return. 7 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_INVALID_WORKER_FUNCTION.rst: -------------------------------------------------------------------------------- 1 | =============================== 2 | GEARMAN_INVALID_WORKER_FUNCTION 3 | =============================== 4 | 5 | Please see :c:type:`GEARMAN_INVALID_WORKER_FUNCTION` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_NO_REGISTERED_FUNCTIONS.rst: -------------------------------------------------------------------------------- 1 | =============================== 2 | GEARMAN_NO_REGISTERED_FUNCTIONS 3 | =============================== 4 | 5 | Please see :c:type:`GEARMAN_NO_REGISTERED_FUNCTIONS` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_MEMORY_ALLOCATION_FAILURE.rst: -------------------------------------------------------------------------------- 1 | ================================= 2 | GEARMAN_MEMORY_ALLOCATION_FAILURE 3 | ================================= 4 | 5 | Please see :c:type:`GEARMAN_MEMORY_ALLOCATION_FAILURE` 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_RECV_IN_PROGRESS.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | GEARMAN_RECV_IN_PROGRESS 3 | ======================== 4 | 5 | This is a server only related error, and will not be found in any client or worker return. 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_SEND_IN_PROGRESS.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | GEARMAN_SEND_IN_PROGRESS 3 | ======================== 4 | 5 | This is a server only related error, and will not be found in any client or 6 | worker return. 7 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_SHUTDOWN_GRACEFUL.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | GEARMAN_SHUTDOWN_GRACEFUL 3 | ========================= 4 | 5 | This is a server only related error, and will not be found in any client or 6 | worker return. 7 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_IO_WAIT.rst: -------------------------------------------------------------------------------- 1 | =============== 2 | GEARMAN_IO_WAIT 3 | =============== 4 | 5 | Blocking IO was found. gearman_continue() can be used for testing this. 6 | 7 | Please see :c:type:`GEARMAN_IO_WAIT` for additional information. 8 | 9 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_misc_functions.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Misc libgearman Functions 3 | ========================= 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | gearman_parse_servers 9 | gearman_bugreport 10 | gearman_version 11 | -------------------------------------------------------------------------------- /support/gearmand.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: gearmand 7 | Description: Gearman Server and C Library 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lgearman 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /scripts/travis-linux.sh: -------------------------------------------------------------------------------- 1 | sudo apt-get update -qq 2 | COMPILER_PACKAGE=$CXX 3 | if echo "$COMPILER_PACKAGE" | grep -q '^clang++-'; then 4 | COMPILER_PACKAGE=$CC 5 | fi 6 | sudo apt-get install -y libboost-all-dev gperf libevent-dev uuid-dev python-sphinx libhiredis-dev $COMPILER_PACKAGE 7 | -------------------------------------------------------------------------------- /docs/source/how_to_report_a_bug.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | How to report a bug 3 | =================== 4 | 5 | Bugs for Gearmand can be reported at https://github.com/gearman/gearmand/issues/. On the right side of the page you will see the link to "Report a bug", alongside links to ask questions, submit code, etc. 6 | -------------------------------------------------------------------------------- /docs/source/libgearman/errors/GEARMAN_PAUSE.rst: -------------------------------------------------------------------------------- 1 | ============= 2 | GEARMAN_PAUSE 3 | ============= 4 | 5 | Used only in custom application for client return based on GEARMAN_WORK_DATA, GEARMAN_WORK_WARNING, GEARMAN_TASK_STATE_EXCEPTION, or GEARMAN_WORK_STATUS. 6 | 7 | Please see :c:type:`GEARMAN_PAUSE` for additional information. 8 | -------------------------------------------------------------------------------- /support/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | EXTRA_DIST+= support/gearmand.init 6 | EXTRA_DIST+= support/gearmand.pc 7 | EXTRA_DIST+= support/gearmand.spec 8 | 9 | pkgconfigdir = $(libdir)/pkgconfig 10 | pkgconfig_DATA = support/gearmand.pc 11 | -------------------------------------------------------------------------------- /scripts/upstart/gearman-job-server-monitor: -------------------------------------------------------------------------------- 1 | description "Notify root about gearman job server respawn limit reached" 2 | author "Goran Miskovic " 3 | 4 | task 5 | 6 | start on stopped gearman-job-server PROCESS=respawn 7 | 8 | script 9 | echo "Gearman Job Server reached respawn limit" | mail -s "Gearman Job Server Crashed" root 10 | end script -------------------------------------------------------------------------------- /scripts/README.solaris: -------------------------------------------------------------------------------- 1 | smf_install.sh is a script that will install gearman as a service monitored 2 | by the Solaris SMF. 3 | 4 | It will define a user and group named gearmand, and create authorization and 5 | profile definitions so that you can grant users the rights to start / stop 6 | or change the service. 7 | 8 | You need administrative rights to run the profile shell script. 9 | -------------------------------------------------------------------------------- /libgearman-server/error/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential 4 | 5 | libgearman_server_libgearman_server_la_SOURCES+= \ 6 | libgearman-server/error/strerror.cc 7 | 8 | noinst_HEADERS+= \ 9 | libgearman-server/error.h \ 10 | libgearman-server/error/strerror.h \ 11 | libgearman-server/error/type.h 12 | -------------------------------------------------------------------------------- /libtest/run.gdb: -------------------------------------------------------------------------------- 1 | set print pretty on 2 | set print object on 3 | set print static-members on 4 | set print vtbl on 5 | set print demangle on 6 | set demangle-style gnu-v3 7 | set logging on 8 | set logging overwrite on 9 | set environment LIBTEST_IN_GDB=1 10 | #set ASAN_OPTIONS=abort_on_error=1 11 | set detach-on-fork on 12 | handle SIGVTALRM stop 13 | run 14 | thread apply all bt 15 | -------------------------------------------------------------------------------- /m4/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2012 DataDifferential 4 | # 5 | # All rights reserved. 6 | # 7 | # Use and distribution licensed under the BSD license. See 8 | # the COPYING file in the parent directory for full text. 9 | # 10 | # Included from Top Level Makefile.am 11 | # All paths should be given relative to the root 12 | 13 | -------------------------------------------------------------------------------- /docs/source/gearmand/queues/sqlite.rst: -------------------------------------------------------------------------------- 1 | ====== 2 | SQLite 3 | ====== 4 | 5 | 6 | The current schema, as of .21 is:: 7 | 8 | CREATE TABLE ( unique_key TEXT, 9 | function_name TEXT, 10 | priority INTEGER, 11 | data BLOB, 12 | when_to_run INTEGER, 13 | PRIMARY KEY (unique_key, function_name)); 14 | -------------------------------------------------------------------------------- /tests/libgearman-1.0/1077917.c: -------------------------------------------------------------------------------- 1 | /* 2 | Look for any basic issue that valgrind might flag. 3 | 4 | https://bugs.launchpad.net/gearmand/+bug/1077917 5 | */ 6 | 7 | #include 8 | 9 | int main (int argc, char **argv) 10 | { 11 | (void)argc; 12 | (void)argv; 13 | gearman_client_st client; 14 | 15 | gearman_client_create(&client); 16 | gearman_client_free(&client); 17 | 18 | exit( 0 ); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /docker/testing/fedora/32/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand-testing 2 | IMAGE_BASE = fedora 3 | IMAGE_VERSION = 32 4 | IMAGE_TAG = $(IMAGE_NAME)/${IMAGE_BASE}:$(IMAGE_VERSION) 5 | USE_CACHE ?= 6 | 7 | image: 8 | @echo "Building Docker image ${IMAGE_TAG}..." 9 | -docker build $(USE_CACHE) --network=host -t $(IMAGE_TAG) . && (docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 10 | 11 | image-no-cache: 12 | $(MAKE) -e USE_CACHE=--no-cache 13 | -------------------------------------------------------------------------------- /docker/testing/fedora/36/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand-testing 2 | IMAGE_BASE = fedora 3 | IMAGE_VERSION = 36 4 | IMAGE_TAG = $(IMAGE_NAME)/${IMAGE_BASE}:$(IMAGE_VERSION) 5 | USE_CACHE ?= 6 | 7 | image: 8 | @echo "Building Docker image ${IMAGE_TAG}..." 9 | -docker build $(USE_CACHE) --network=host -t $(IMAGE_TAG) . && (docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 10 | 11 | image-no-cache: 12 | $(MAKE) -e USE_CACHE=--no-cache 13 | -------------------------------------------------------------------------------- /docker/testing/alpine/3.12/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand-testing 2 | IMAGE_BASE = alpine 3 | IMAGE_VERSION = 3.12 4 | IMAGE_TAG = $(IMAGE_NAME)/${IMAGE_BASE}:$(IMAGE_VERSION) 5 | USE_CACHE ?= 6 | 7 | image: 8 | @echo "Building Docker image ${IMAGE_TAG}..." 9 | -docker build $(USE_CACHE) --network=host -t $(IMAGE_TAG) . && (docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 10 | 11 | image-no-cache: 12 | $(MAKE) -e USE_CACHE=--no-cache 13 | -------------------------------------------------------------------------------- /docker/testing/alpine/3.13/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand-testing 2 | IMAGE_BASE = alpine 3 | IMAGE_VERSION = 3.13 4 | IMAGE_TAG = $(IMAGE_NAME)/${IMAGE_BASE}:$(IMAGE_VERSION) 5 | USE_CACHE ?= 6 | 7 | image: 8 | @echo "Building Docker image ${IMAGE_TAG}..." 9 | -docker build $(USE_CACHE) --network=host -t $(IMAGE_TAG) . && (docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 10 | 11 | image-no-cache: 12 | $(MAKE) -e USE_CACHE=--no-cache 13 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/14.04/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand-testing 2 | IMAGE_BASE = ubuntu 3 | IMAGE_VERSION = 14.04 4 | IMAGE_TAG = $(IMAGE_NAME)/${IMAGE_BASE}:$(IMAGE_VERSION) 5 | USE_CACHE ?= 6 | 7 | image: 8 | @echo "Building Docker image ${IMAGE_TAG}..." 9 | -docker build $(USE_CACHE) --network=host -t $(IMAGE_TAG) . && (docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 10 | 11 | image-no-cache: 12 | $(MAKE) -e USE_CACHE=--no-cache 13 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/16.04/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand-testing 2 | IMAGE_BASE = ubuntu 3 | IMAGE_VERSION = 16.04 4 | IMAGE_TAG = $(IMAGE_NAME)/${IMAGE_BASE}:$(IMAGE_VERSION) 5 | USE_CACHE ?= 6 | 7 | image: 8 | @echo "Building Docker image ${IMAGE_TAG}..." 9 | -docker build $(USE_CACHE) --network=host -t $(IMAGE_TAG) . && (docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 10 | 11 | image-no-cache: 12 | $(MAKE) -e USE_CACHE=--no-cache 13 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/18.04/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand-testing 2 | IMAGE_BASE = ubuntu 3 | IMAGE_VERSION = 18.04 4 | IMAGE_TAG = $(IMAGE_NAME)/${IMAGE_BASE}:$(IMAGE_VERSION) 5 | USE_CACHE ?= 6 | 7 | image: 8 | @echo "Building Docker image ${IMAGE_TAG}..." 9 | -docker build $(USE_CACHE) --network=host -t $(IMAGE_TAG) . && (docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 10 | 11 | image-no-cache: 12 | $(MAKE) -e USE_CACHE=--no-cache 13 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/20.04/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand-testing 2 | IMAGE_BASE = ubuntu 3 | IMAGE_VERSION = 20.04 4 | IMAGE_TAG = $(IMAGE_NAME)/${IMAGE_BASE}:$(IMAGE_VERSION) 5 | USE_CACHE ?= 6 | 7 | image: 8 | @echo "Building Docker image ${IMAGE_TAG}..." 9 | -docker build $(USE_CACHE) --network=host -t $(IMAGE_TAG) . && (docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 10 | 11 | image-no-cache: 12 | $(MAKE) -e USE_CACHE=--no-cache 13 | -------------------------------------------------------------------------------- /tests/perl/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2012 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | 13 | 14 | EXTRA_DIST+= tests/perl/worker/echo.pl 15 | -------------------------------------------------------------------------------- /docs/source/gearmand/queues/drizzle.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | Drizzle 3 | ======= 4 | 5 | 6 | The current schema, as of .21 is:: 7 | 8 | CREATE TABLE
( unique_key VARCHAR(GEARMAN_UNIQUE_SIZE), 9 | function_name VARCHAR(255), 10 | priority INT, 11 | data LONGBLOB, 12 | when_to_run BIGINT, 13 | unique key (unique_key, function_name)); 14 | -------------------------------------------------------------------------------- /docs/source/libgearman/types.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | Required C types 3 | ================ 4 | 5 | .. highlight:: c 6 | 7 | Types 8 | ----- 9 | 10 | C Types Used 11 | ------------ 12 | 13 | .. c:type:: bool 14 | 15 | .. c:type:: uint32_t 16 | 17 | .. c:type:: int64_t 18 | 19 | .. c:type:: uint64_t 20 | 21 | .. c:type:: in_port_t 22 | 23 | .. c:type:: size_t 24 | 25 | .. c:type:: time_t 26 | 27 | .. c:type:: timespec 28 | 29 | .. c:type:: sasl_callback_t 30 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Brian Aker brian@tangent.org 2 | John Ewart john@johnewart.net, Initial Epoch support 3 | Eric Day eday@oddments.org 4 | Trond Norbye trond.norbye@gmail.com 5 | Brian Moon 6 | Cory Bennett 7 | Clint clint@fewbar.com 8 | cmooney@concentric.com 9 | Jedi/Sector One 10 | Piotr Sikora 11 | Joe Daly 12 | Steve Yen 13 | Rhett Garber 14 | -------------------------------------------------------------------------------- /docker/testing/centos/7/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand-testing 2 | IMAGE_BASE = centos 3 | IMAGE_VERSION = 7 4 | IMAGE_LABEL = v$(IMAGE_VERSION) 5 | IMAGE_TAG = $(IMAGE_NAME)/${IMAGE_BASE}:$(IMAGE_VERSION) 6 | USE_CACHE ?= 7 | 8 | image: 9 | @echo "Building Docker image ${IMAGE_TAG}..." 10 | -docker build $(USE_CACHE) --network=host -t $(IMAGE_TAG) . && (docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 11 | 12 | image-no-cache: 13 | $(MAKE) -e USE_CACHE=--no-cache 14 | -------------------------------------------------------------------------------- /libhashkit/include.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2012 Data Differential, LLC. 2 | dnl This file is free software; Data Differential, LLC. 3 | dnl gives unlimited permission to copy and/or distribute it, 4 | dnl with or without modifications, as long as this notice is preserved. 5 | 6 | HASHKIT_LIBRARY_VERSION=2:0:0 7 | AC_SUBST(HASHKIT_LIBRARY_VERSION) 8 | 9 | AC_CONFIG_FILES([libhashkit/hashkitcon.h]) 10 | AC_CONFIG_FILES([libhashkit-1.0/configure.h]) 11 | AM_CONDITIONAL([INCLUDE_HSIEH_SRC],[false]) 12 | -------------------------------------------------------------------------------- /docker/testing/centos/7-32bit/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand-testing 2 | IMAGE_BASE = centos.i686 3 | IMAGE_VERSION = 7 4 | IMAGE_LABEL = v$(IMAGE_VERSION) 5 | IMAGE_TAG = $(IMAGE_NAME)/${IMAGE_BASE}:$(IMAGE_VERSION) 6 | USE_CACHE ?= 7 | 8 | image: 9 | @echo "Building Docker image ${IMAGE_TAG}..." 10 | -docker build $(USE_CACHE) --network=host -t $(IMAGE_TAG) . && (docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 11 | 12 | image-no-cache: 13 | $(MAKE) -e USE_CACHE=--no-cache 14 | -------------------------------------------------------------------------------- /libgearman-server/plugins/protocol/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | include libgearman-server/plugins/protocol/http/include.am 13 | include libgearman-server/plugins/protocol/gear/include.am 14 | -------------------------------------------------------------------------------- /libtest/yatl.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2012 Data Differential, LLC. 2 | dnl This file is free software; Data Differential, LLC. 3 | dnl gives unlimited permission to copy and/or distribute it, 4 | dnl with or without modifications, as long as this notice is preserved. 5 | 6 | AC_SUBST([LIBTEST_VERSION],[1.0]) 7 | AC_CONFIG_FILES([libtest/version.h]) 8 | 9 | m4_include([libtest/m4/mysql.m4]) 10 | 11 | YATL_MYSQL 12 | 13 | AC_CONFIG_FILES([libtest/yatlcon.h]) 14 | AC_CHECK_HEADERS([valgrind/valgrind.h]) 15 | -------------------------------------------------------------------------------- /libgearman-server/plugins/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential 4 | 5 | noinst_HEADERS+= libgearman-server/plugins/base.h 6 | noinst_HEADERS+= libgearman-server/plugins/protocol.h 7 | noinst_HEADERS+= libgearman-server/plugins/queue.h 8 | 9 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/base.cc 10 | 11 | include libgearman-server/plugins/protocol/include.am 12 | include libgearman-server/plugins/queue/include.am 13 | -------------------------------------------------------------------------------- /docs/source/gearmand/queues.rst: -------------------------------------------------------------------------------- 1 | ============== 2 | Durable Queues 3 | ============== 4 | 5 | Durable queues store jobs so that in the case of a failure of a Gearman server, the background jobs will run once the server is restarted. 6 | 7 | Currently Drizzle, MySQL, Postgres, TokyoCabinet, Memcached, and SQLite can all be used as backends. 8 | 9 | ------- 10 | Details 11 | ------- 12 | 13 | .. toctree:: 14 | :titlesonly: 15 | 16 | queues/drizzle 17 | queues/mysql 18 | queues/postgres 19 | queues/sqlite 20 | -------------------------------------------------------------------------------- /scripts/gearmand.in: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | # 3 | # Script used to start Gearman from Solaris SMF 4 | # 5 | . /lib/svc/share/smf_include.sh 6 | 7 | prefix=@prefix@ 8 | exec_prefix=@exec_prefix@ 9 | 10 | case "$1" in 11 | 'start') 12 | /bin/coreadm -p "`svcprop -p gearman/corepattern $SMF_FMRI`" $$ 13 | @sbindir@/gearmand -d 14 | ;; 15 | 16 | 'stop') 17 | smf_kill_contract $2 TERM 1 18 | ;; 19 | 20 | *) 21 | echo "Usage: $0 {start|stop}" 22 | exit 1 23 | ;; 24 | esac 25 | 26 | exit $SMF_EXIT_OK 27 | -------------------------------------------------------------------------------- /m4/drizzled.m4: -------------------------------------------------------------------------------- 1 | AX_WITH_PROG(DRIZZLED_BINARY,drizzled) 2 | AS_IF([test -f "$ac_cv_path_DRIZZLED_BINARY"], 3 | [ 4 | AC_DEFINE([HAVE_DRIZZLED_BINARY], [1], [If Memcached binary is available]) 5 | AC_DEFINE_UNQUOTED([DRIZZLED_BINARY], "$ac_cv_path_DRIZZLED_BINARY", [Name of the drizzled binary used in make test]) 6 | ], 7 | [ 8 | AC_DEFINE([HAVE_DRIZZLED_BINARY], [0], [If Memcached binary is available]) 9 | AC_DEFINE([DRIZZLED_BINARY], [0], [Name of the drizzled binary used in make test]) 10 | ]) 11 | -------------------------------------------------------------------------------- /m4/pandora_extensions.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2009 Sun Microsystems, Inc. 2 | dnl This file is free software; Sun Microsystems, Inc. 3 | dnl gives unlimited permission to copy and/or distribute it, 4 | dnl with or without modifications, as long as this notice is preserved. 5 | 6 | AC_DEFUN([PANDORA_EXTENSIONS],[ 7 | 8 | m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], 9 | [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], 10 | [AC_REQUIRE([AC_GNU_SOURCE])]) 11 | 12 | ]) 13 | 14 | AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],[ 15 | AC_REQUIRE([PANDORA_EXTENSIONS]) 16 | ]) 17 | -------------------------------------------------------------------------------- /libgearman-1.0/t/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | 3 | # Test linking with C application 4 | libgearman_1_0_t_c_test_SOURCES= libgearman-1.0/t/c_test.c 5 | libgearman_1_0_t_c_test_LDADD= libgearman/libgearman.la 6 | check_PROGRAMS+= libgearman-1.0/t/c_test 7 | noinst_PROGRAMS+= libgearman-1.0/t/c_test 8 | 9 | # Test linking with C application 10 | libgearman_1_0_t_cc_test_SOURCES= libgearman-1.0/t/cc_test.cc 11 | libgearman_1_0_t_cc_test_LDADD= libgearman/libgearman.la 12 | check_PROGRAMS+= libgearman-1.0/t/cc_test 13 | noinst_PROGRAMS+= libgearman-1.0/t/cc_test 14 | -------------------------------------------------------------------------------- /libgearman-server/plugins/queue/default/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2012 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | noinst_HEADERS+= libgearman-server/plugins/queue/default/queue.h 13 | 14 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/queue/default/queue.cc 15 | -------------------------------------------------------------------------------- /libgearman-server/plugins/protocol/gear/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2012 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | noinst_HEADERS+= libgearman-server/plugins/protocol/gear/protocol.h 13 | 14 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/protocol/gear/protocol.cc 15 | -------------------------------------------------------------------------------- /docker/example/gearmand/gearmand.conf: -------------------------------------------------------------------------------- 1 | [program:gearmand] 2 | user = gearman 3 | priority = 100 4 | ###command = /usr/sbin/gearmand --port 4730 --ssl --ssl-ca-file /var/lib/gearman/gearmand-ca.pem --ssl-certificate /var/lib/gearman/gearmand.pem --ssl-key /var/lib/gearman/gearmand.key --verbose INFO -l /var/log/gearmand.log 5 | command = /usr/sbin/gearmand --port 4730 --verbose INFO -l /var/log/gearman.log 6 | redirect_stderr = true 7 | stdout_logfile = /var/log/supervisor/gearman.log 8 | stdout_logfile_maxbytes = 50MB 9 | stdout_logfile_backups = 10 10 | startsecs = 5 11 | autorestart = true 12 | -------------------------------------------------------------------------------- /docs/source/build/fedora.rst: -------------------------------------------------------------------------------- 1 | ====== 2 | Fedora 3 | ====== 4 | 5 | You will need to install the following packages in order to build Gearman. 6 | 7 | sudo yum install -y gcc gcc-c++ 8 | 9 | sudo yum install -y make 10 | 11 | sudo yum install -y bison 12 | 13 | sudo yum install -y flex 14 | 15 | sudo yum install -y autoconf 16 | 17 | sudo yum install -y libtool 18 | 19 | sudo yum install -y memcached 20 | 21 | sudo yum install -y libevent libevent-devel 22 | 23 | sudo yum install -y uuidd libuuid libuuid-devel 24 | 25 | sudo yum install -y boost boost-devel 26 | 27 | sudo yum install -y libcurl-dev libcurl curl 28 | -------------------------------------------------------------------------------- /tests/cpp_test.cc: -------------------------------------------------------------------------------- 1 | /* Gearman server and library 2 | * Copyright (C) 2008 Brian Aker, Eric Day 3 | * All rights reserved. 4 | * 5 | * Use and distribution licensed under the BSD license. See 6 | * the COPYING file in the parent directory for full text. 7 | */ 8 | 9 | /* 10 | * @brief C++ dummy test, aka testing C++ linking, etc 11 | */ 12 | 13 | #include // For EXIT_SUCCESS 14 | 15 | #include 16 | 17 | int main(void) 18 | { 19 | gearman_client_st client; 20 | 21 | gearman_client_create(&client); 22 | gearman_client_free(&client); 23 | 24 | return EXIT_SUCCESS; 25 | } 26 | -------------------------------------------------------------------------------- /libgearman-server/plugins/queue/redis/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | noinst_HEADERS+= libgearman-server/plugins/queue/redis/queue.h 13 | 14 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/queue/redis/queue.cc 15 | libgearman_server_libgearman_server_la_LIBADD+= @HIREDIS_LIB@ 16 | 17 | -------------------------------------------------------------------------------- /m4/libdrizzle.m4: -------------------------------------------------------------------------------- 1 | # serial 1 2 | AC_DEFUN([_WITH_LIBDRIZZLE], 3 | [AC_ARG_ENABLE([libdrizzle], 4 | [AS_HELP_STRING([--disable-libdrizzle], 5 | [Build with libdrizzle support @<:@default=on@:>@])], 6 | [ac_enable_libdrizzle="$enableval"], 7 | [ac_enable_libdrizzle="yes"]) 8 | 9 | AS_IF([test "x$ac_enable_libdrizzle" = "xyes"], 10 | [AX_CHECK_LIBRARY([LIBDRIZZLE],[libdrizzle-5.1/drizzle_client.h],[drizzle],, 11 | [AC_DEFINE([HAVE_LIBDRIZZLE],[0],[Have libdrizzle])])], 12 | [AC_DEFINE([HAVE_LIBDRIZZLE],[0],[Have libdrizzle])]) 13 | ]) 14 | 15 | AC_DEFUN([WITH_LIBDRIZZLE], [ AC_REQUIRE([_WITH_LIBDRIZZLE]) ]) 16 | -------------------------------------------------------------------------------- /m4/pandora_clock_gettime.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2010 Monty Taylor 2 | dnl This file is free software; Monty Taylor 3 | dnl gives unlimited permission to copy and/or distribute it, 4 | dnl with or without modifications, as long as this notice is preserved. 5 | 6 | #-------------------------------------------------------------------- 7 | # Check for clock_gettime 8 | #-------------------------------------------------------------------- 9 | 10 | AC_DEFUN([PANDORA_CLOCK_GETTIME],[ 11 | AC_SEARCH_LIBS([clock_gettime],[rt]) 12 | AS_IF([test "x${ac_cv_search_clock_gettime}" != "xno"],[ 13 | AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Have a working clock_gettime function]) 14 | ]) 15 | ]) 16 | -------------------------------------------------------------------------------- /util/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # DataDifferential Utility Library 3 | # Copyright (C) 2011-2013 Data Differential 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | 12 | noinst_HEADERS+= util/memory.h 13 | noinst_HEADERS+= util/noncopyable.hpp 14 | noinst_HEADERS+= \ 15 | util/daemon.hpp \ 16 | util/instance.hpp \ 17 | util/logfile.hpp \ 18 | util/log.hpp \ 19 | util/operation.hpp \ 20 | util/signal.hpp \ 21 | util/string.hpp \ 22 | util/pidfile.hpp 23 | -------------------------------------------------------------------------------- /libgearman-server/plugins/queue/tokyocabinet/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | noinst_HEADERS+= libgearman-server/plugins/queue/tokyocabinet/queue.h 13 | 14 | if HAVE_TOKYOCABINET 15 | 16 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/queue/tokyocabinet/queue.cc 17 | 18 | libgearman_server_libgearman_server_la_LIBADD+= @TOKYOCABINET_LIB@ 19 | 20 | endif 21 | 22 | -------------------------------------------------------------------------------- /libhashkit/murmur3.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // MurmurHash3 was written by Austin Appleby, and is placed in the 3 | // public domain. The author hereby disclaims copyright to this source 4 | // code. 5 | 6 | #pragma once 7 | 8 | //----------------------------------------------------------------------------- 9 | 10 | void MurmurHash3_x86_32 (const void *key, int len, uint32_t seed, void *out); 11 | 12 | void MurmurHash3_x86_128(const void *key, int len, uint32_t seed, void *out); 13 | 14 | void MurmurHash3_x64_128(const void *key, int len, uint32_t seed, void *out); 15 | 16 | //----------------------------------------------------------------------------- 17 | -------------------------------------------------------------------------------- /scripts/upstart/gearman-job-server.conf: -------------------------------------------------------------------------------- 1 | description "Upstart configuration for Gearman Job Server" 2 | author "Goran Miskovic " 3 | 4 | # Start on startup 5 | # Upstart itself emits a single event called startup 6 | start on startup 7 | stop on runlevel [016] 8 | 9 | respawn 10 | 11 | pre-start script 12 | logger -is -t "$UPSTART_JOB" "INFO: Starting Gearman Job Server!" 13 | end script 14 | 15 | setuid gearman 16 | setgid gearman 17 | 18 | exec /usr/sbin/gearmand 19 | 20 | post-start script 21 | logger -is -t "$UPSTART_JOB" "INFO: Gearman Job Server started!" 22 | end script 23 | 24 | post-stop script 25 | logger -is -t "$UPSTART_JOB" "INFO: Gearman Job Server stopped!" 26 | end script -------------------------------------------------------------------------------- /docker/example/gearmand/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand 2 | IMAGE_VERSION = 1.1.22 3 | USE_CACHE ?= 4 | 5 | image: 6 | @echo "Building Docker image ${IMAGE_NAME}:${IMAGE_VERSION}..." 7 | -docker build $(USE_CACHE) --network=host --build-arg version=$(IMAGE_VERSION) -t $(IMAGE_NAME):$(IMAGE_VERSION) . 8 | -(docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 9 | 10 | image-no-cache: 11 | $(MAKE) -e USE_CACHE=--no-cache 12 | 13 | latest: image 14 | @echo "Tagging Docker image ${IMAGE_NAME}:${IMAGE_VERSION} with latest..." 15 | -docker tag `docker image ls --format '{{.ID}}' $(IMAGE_NAME):$(IMAGE_VERSION)` $(IMAGE_NAME):latest 16 | -(docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 17 | -------------------------------------------------------------------------------- /docker/example/supervisord/Makefile: -------------------------------------------------------------------------------- 1 | IMAGE_NAME = gearmand/supervisord 2 | IMAGE_VERSION = 1.0 3 | USE_CACHE ?= 4 | 5 | image: 6 | @echo "Building Docker image ${IMAGE_NAME}:${IMAGE_VERSION}..." 7 | -docker build $(USE_CACHE) --build-arg version=$(IMAGE_VERSION) -t $(IMAGE_NAME):$(IMAGE_VERSION) . 8 | -(docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 9 | 10 | image-no-cache: 11 | $(MAKE) -e USE_CACHE=--no-cache 12 | 13 | latest: image 14 | @echo "Tagging Docker image ${IMAGE_NAME}:${IMAGE_VERSION} with latest..." 15 | -docker tag `docker image ls --format '{{.ID}}' $(IMAGE_NAME):$(IMAGE_VERSION)` $(IMAGE_NAME):latest 16 | -(docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi) 17 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_bugreport.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | gearman_bugreport() 3 | =================== 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:function:: const char *gearman_bugreport(void) 12 | 13 | Link with -lgearman 14 | 15 | ----------- 16 | DESCRIPTION 17 | ----------- 18 | 19 | :c:func:`gearman_bugreport` returns the url to the bug tracking site for Gearmand 20 | 21 | ------------ 22 | RETURN VALUE 23 | ------------ 24 | 25 | URL 26 | 27 | ---- 28 | HOME 29 | ---- 30 | 31 | To find out more information please check: 32 | `https://gearman.org/gearmand/ `_ 33 | 34 | 35 | .. seealso:: 36 | 37 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 38 | -------------------------------------------------------------------------------- /docs/source/build/ubuntu.rst: -------------------------------------------------------------------------------- 1 | ====== 2 | Ubuntu 3 | ====== 4 | 5 | You will need to install the following packages in order to build Gearman. 6 | 7 | sudo apt-get install --yes gcc 8 | 9 | sudo apt-get install --yes autoconf 10 | 11 | sudo apt-get install --yes bison 12 | 13 | sudo apt-get install --yes flex 14 | 15 | sudo apt-get install --yes libtool 16 | 17 | sudo apt-get install --yes make 18 | 19 | sudo apt-get install --yes libboost-all-dev 20 | 21 | sudo apt-get install --yes libcurl4-openssl-dev curl 22 | 23 | sudo apt-get install --yes libevent-dev 24 | 25 | sudo apt-get install --yes memcached 26 | 27 | sudo apt-get install --yes uuid-dev 28 | 29 | sudo apt-get install --yes libsqlite3-dev 30 | 31 | sudo apt-get install --yes libmysqlclient-dev 32 | -------------------------------------------------------------------------------- /docs/source/license.rst: -------------------------------------------------------------------------------- 1 | ======================= 2 | Documentation Licensing 3 | ======================= 4 | 5 | --------------------- 6 | Documentation Content 7 | --------------------- 8 | 9 | .. image:: cc-symbol.png 10 | :alt: Creative Commons License 11 | :target: http://creativecommons.org/licenses/by-sa/4.0/ 12 | 13 | Gearman Documentation (gearman.org) is licensed under a `Attribution-ShareAlike 4.0 International License `_. 14 | 15 | If you need to have the documention licensed in a different manner, please contact `Data Differential `_. 16 | 17 | ------------------------ 18 | Server and C/C++ library 19 | ------------------------ 20 | 21 | Gearmand is released under the BSD license. 22 | -------------------------------------------------------------------------------- /tests/redis.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | t_redis_CXXFLAGS= 13 | t_redis_SOURCES= 14 | t_redis_LDADD= 15 | 16 | t_redis_LDADD+= ${CLIENT_LDADD} 17 | t_redis_SOURCES+= tests/basic.cc 18 | t_redis_SOURCES+= tests/redis.cc 19 | 20 | check_PROGRAMS += t/redis 21 | noinst_PROGRAMS += t/redis 22 | 23 | test-redis: t/redis gearmand/gearmand 24 | @t/redis 25 | 26 | gdb-redis: t/redis gearmand/gearmand 27 | @$(GDB_COMMAND) t/redis 28 | -------------------------------------------------------------------------------- /m4/have_libpq.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2011 Brian Aker (brian@tangent.org) 2 | 3 | AC_DEFUN([AX_HAVE_LIBPQ],[ 4 | AC_ARG_ENABLE([libpq], 5 | [AS_HELP_STRING([--disable-libpq], 6 | [Build with libpq, ie Postgres, support @<:@default=on@:>@])], 7 | [ac_cv_libpq="$enableval"], 8 | [ac_cv_libpq="yes"]) 9 | 10 | AC_REQUIRE([AX_LIB_POSTGRESQL]) 11 | 12 | AS_IF([test "x$ac_cv_libpq" = "xyes" -a "x$found_postgresql" = "xyes"], 13 | [ 14 | AC_DEFINE([HAVE_LIBPQ], [ 1 ], [Enable libpq support]) 15 | ], 16 | [ 17 | AC_DEFINE([HAVE_LIBPQ], [ 0 ], [Enable libpq support]) 18 | # if --enable-libpq, but no Postgres, force --disable-libpq 19 | ac_cv_libpq="no" 20 | ]) 21 | 22 | AM_CONDITIONAL(HAVE_LIBPQ, [test "x$ac_cv_libpq" = "xyes"]) 23 | ]) 24 | -------------------------------------------------------------------------------- /libgearman-server/plugins/queue/drizzle/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | noinst_HEADERS+= libgearman-server/plugins/queue/drizzle/queue.h 13 | 14 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/queue/drizzle/queue.cc 15 | libgearman_server_libgearman_server_la_LIBADD+= @LIBDRIZZLE_LDFLAGS@ 16 | libgearman_server_libgearman_server_la_LIBADD+= @LIBDRIZZLE_LIB@ 17 | 18 | gearmand_gearmand_LDADD+= @LIBDRIZZLE_LDFLAGS@ 19 | gearmand_gearmand_LDADD+= @LIBDRIZZLE_LIB@ 20 | -------------------------------------------------------------------------------- /docker/example/supervisord/supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file=/var/run/supervisor/supervisor.sock ; (the path to the socket file) 3 | chmod=0770 ; socket file mode (default 0700) 4 | chown=root:supervisor ; socket file uid:gid owner 5 | 6 | [supervisord] 7 | nodaemon=true 8 | logfile=/var/log/supervisor/supervisord.log 9 | pidfile=/var/run/supervisor/supervisord.pid 10 | stdout_logfile_maxbytes = 50MB 11 | stdout_logfile_backups = 10 12 | loglevel=info ; (default: info; others: debug, warn, trace) 13 | 14 | [rpcinterface:supervisor] 15 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 16 | 17 | [supervisorctl] 18 | serverurl=unix:///var/run/supervisor/supervisor.sock 19 | 20 | [include] 21 | files = /etc/supervisor/conf.d/*.conf 22 | -------------------------------------------------------------------------------- /libgearman-server/plugins/queue/postgres/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | noinst_HEADERS+= libgearman-server/plugins/queue/postgres/queue.h 13 | 14 | if HAVE_LIBPQ 15 | 16 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/queue/postgres/queue.cc 17 | libgearman_server_libgearman_server_la_LIBADD+= $(POSTGRESQL_LDFLAGS) 18 | libgearman_server_libgearman_server_la_CXXFLAGS+= $(POSTGRESQL_CFLAGS) 19 | 20 | gearmand_gearmand_LDADD+= $(POSTGRESQL_LDFLAGS) 21 | 22 | endif 23 | 24 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_version.rst: -------------------------------------------------------------------------------- 1 | ================= 2 | gearman_version() 3 | ================= 4 | 5 | 6 | -------- 7 | SYNOPSIS 8 | -------- 9 | 10 | #include 11 | 12 | .. c:function:: const char *gearman_version(gearman_verbose_t verbose) 13 | 14 | Link with -lgearman 15 | 16 | ----------- 17 | DESCRIPTION 18 | ----------- 19 | 20 | 21 | Return the version of the library. 22 | 23 | 24 | ------------ 25 | RETURN VALUE 26 | ------------ 27 | 28 | A constant C style string. No deallocation is required. 29 | 30 | ---- 31 | HOME 32 | ---- 33 | 34 | 35 | To find out more information please check: 36 | `https://gearman.org/gearmand/ `_ 37 | 38 | 39 | -------- 40 | SEE ALSO 41 | -------- 42 | 43 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 44 | -------------------------------------------------------------------------------- /libgearman-server/plugins/queue/libmemcached/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | noinst_HEADERS+= libgearman-server/plugins/queue/libmemcached/queue.h 13 | 14 | if HAVE_LIBMEMCACHED 15 | 16 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/queue/libmemcached/queue.cc 17 | libgearman_server_libgearman_server_la_CXXFLAGS+= $(LIBMEMCACHED_CFLAGS) 18 | libgearman_server_libgearman_server_la_LIBADD+= $(LIBMEMCACHED_LIB) 19 | 20 | gearmand_gearmand_LDADD+= $(LIBMEMCACHED_LIB) 21 | endif 22 | -------------------------------------------------------------------------------- /tests/protocol.mk: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # 3 | # Gearman server and library 4 | # Copyright (C) 2013 Data Differential, http://datadifferential.com/ 5 | # All rights reserved. 6 | # 7 | # Use and distribution licensed under the BSD license. See 8 | # the COPYING file in the parent directory for full text. 9 | 10 | t_protocol_SOURCES= 11 | t_protocol_LDADD= 12 | 13 | t_protocol_SOURCES+= tests/protocol.cc 14 | t_protocol_LDADD+= ${LIBGEARMAN_1_0_CLIENT_LDADD} 15 | t_protocol_LDADD+= libgearman/libgearmancore.la 16 | check_PROGRAMS+= t/protocol 17 | noinst_PROGRAMS+= t/protocol 18 | 19 | test-protocol: t/protocol gearmand/gearmand 20 | @t/protocol 21 | 22 | gdb-protocol: t/protocol gearmand/gearmand 23 | @$(GDB_COMMAND) t/protocol 24 | 25 | valgrind-protocol: t/protocol gearmand/gearmand 26 | @$(VALGRIND_COMMAND) t/protocol 27 | 28 | -------------------------------------------------------------------------------- /libgearman-server/plugins/queue/mysql/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ 4 | # Copyright (C) 2011 Oleksiy Krivoshey 5 | # All rights reserved. 6 | # 7 | # Use and distribution licensed under the BSD license. See 8 | # the COPYING file in the parent directory for full text. 9 | # 10 | # All paths should be given relative to the root 11 | # 12 | 13 | noinst_HEADERS+= libgearman-server/plugins/queue/mysql/queue.h 14 | 15 | if HAVE_LIBMYSQL 16 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/queue/mysql/queue.cc 17 | 18 | libgearman_server_libgearman_server_la_CFLAGS+= @MYSQL_INCLUDE@ 19 | libgearman_server_libgearman_server_la_CXXFLAGS+= @MYSQL_INCLUDE@ 20 | libgearman_server_libgearman_server_la_LDFLAGS+= @MYSQL_LDFLAGS@ 21 | endif 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/source/gearmand/queues/postgres.rst: -------------------------------------------------------------------------------- 1 | ======== 2 | Postgres 3 | ======== 4 | 5 | 6 | The current schema, as of .21 is:: 7 | 8 | CREATE TABLE
( unique_key VARCHAR(GEARMAN_UNIQUE_SIZE), 9 | function_name VARCHAR(255), 10 | priority INTEGER, 11 | data BYTEA, 12 | when_to_run INTEGER, 13 | UNIQUE (unique_key, function_name)); 14 | 15 | 16 | To start gearmand edit /etc/default/gearman-job-server to include:: 17 | 18 | export PGHOST=TheHostname 19 | export PGPORT=5432 20 | export PGUSER=gearman 21 | export PGPASSWORD=ThePassword 22 | export PGDATABASE=gearman 23 | PARAMS="--verbose -q libpq --libpq-table=gearmanqueue1 --verbose" 24 | 25 | This is Debian specific so you will need to adapt it to your distribution. 26 | -------------------------------------------------------------------------------- /libhashkit-1.0/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | # 5 | 6 | EXTRA_DIST+= libhashkit-1.0/configure.h.in 7 | BUILT_SOURCES+= libhashkit-1.0/configure.h 8 | 9 | noinst_HEADERS+= libhashkit-1.0/algorithm.h 10 | noinst_HEADERS+= libhashkit-1.0/behavior.h 11 | noinst_HEADERS+= libhashkit-1.0/configure.h 12 | noinst_HEADERS+= libhashkit-1.0/digest.h 13 | noinst_HEADERS+= libhashkit-1.0/function.h 14 | noinst_HEADERS+= libhashkit-1.0/has.h 15 | noinst_HEADERS+= libhashkit-1.0/hashkit.h 16 | noinst_HEADERS+= libhashkit-1.0/hashkit.hpp 17 | noinst_HEADERS+= libhashkit-1.0/strerror.h 18 | noinst_HEADERS+= libhashkit-1.0/string.h 19 | noinst_HEADERS+= libhashkit-1.0/str_algorithm.h 20 | noinst_HEADERS+= libhashkit-1.0/types.h 21 | noinst_HEADERS+= libhashkit-1.0/visibility.h 22 | -------------------------------------------------------------------------------- /docs/source/build/centos5-8.rst: -------------------------------------------------------------------------------- 1 | ========== 2 | Centos 5.8 3 | ========== 4 | 5 | 6 | A version of Boost >= 1.39 must be installed. 7 | 8 | 1. Download epel-release-5-4.noarch.rpm (or suitable version) from http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F 9 | 10 | 2. Install the EPEL repo list using "rpm -Uvh epel-release-5-4.noarch.rpm" 11 | 12 | 3. yum install boost141-devel 13 | 14 | 4. ln -s /usr/include/boost141/boost/ /usr/include/boost 15 | 16 | 5. export LDFLAGS="-L/usr/lib64/boost141" 17 | 18 | 6. export LD_LIBRARY_PATH=/usr/lib64/boost141:$LD_LIBRARY_PATH 19 | 20 | 7. sudo yum install e2fsprogs-devel e2fsprogs 21 | 22 | 23 | Then: 24 | 25 | 1. yum install gcc44 gcc-c++ 26 | 27 | 2. export CC="gcc44" 28 | 29 | 3. export CXX="g++44" 30 | 31 | Compile and install: 32 | 33 | ./configure 34 | 35 | make 36 | 37 | sudo make install 38 | 39 | -------------------------------------------------------------------------------- /tests/tokyocabinet.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | 13 | t_tokyocabinet_SOURCES= 14 | t_tokyocabinet_LDADD= 15 | 16 | t_tokyocabinet_LDADD+= $(CLIENT_LDADD) 17 | t_tokyocabinet_SOURCES+= tests/tokyocabinet_test.cc 18 | t_tokyocabinet_SOURCES+= tests/basic.cc 19 | check_PROGRAMS+= t/tokyocabinet 20 | noinst_PROGRAMS+= t/tokyocabinet 21 | 22 | test-tokyocabinet: t/tokyocabinet gearmand/gearmand 23 | @t/tokyocabinet 24 | 25 | valgrind-tokyocabinet: t/tokyocabinet gearmand/gearmand 26 | @$(VALGRIND_COMMAND) t/tokyocabinet 27 | -------------------------------------------------------------------------------- /m4/ax_print_to_file.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_print_to_file.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_PRINT_TO_FILE([FILE],[DATA]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Writes the specified data to the specified file. 12 | # 13 | # LICENSE 14 | # 15 | # Copyright (c) 2008 Tom Howard 16 | # 17 | # Copying and distribution of this file, with or without modification, are 18 | # permitted in any medium without royalty provided the copyright notice 19 | # and this notice are preserved. This file is offered as-is, without any 20 | # warranty. 21 | 22 | #serial 7 23 | 24 | AC_DEFUN([AX_PRINT_TO_FILE],[ 25 | AC_REQUIRE([AX_FILE_ESCAPES]) 26 | printf "$2" > "$1" 27 | ]) 28 | -------------------------------------------------------------------------------- /tests/mysql.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | t_mysql_SOURCES= 13 | t_mysql_CXXFLAGS= 14 | t_mysql_LDADD= 15 | 16 | t_mysql_SOURCES+= tests/basic.cc 17 | t_mysql_SOURCES+= tests/mysql_test.cc 18 | 19 | t_mysql_LDADD+= ${CLIENT_LDADD} 20 | 21 | check_PROGRAMS+= t/mysql 22 | noinst_PROGRAMS+= t/mysql 23 | 24 | test-mysql: t/mysql gearmand/gearmand 25 | @t/mysql 26 | 27 | gdb-mysql: t/mysql gearmand/gearmand 28 | @$(GDB_COMMAND) t/mysql 29 | 30 | valgrind-mysql: t/mysql gearmand/gearmand 31 | @$(VALGRIND_COMMAND) t/mysql 32 | -------------------------------------------------------------------------------- /m4/hiredis.m4: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2011 Brian Aker (brian@tangent.org) 2 | # 3 | # serial 2 4 | 5 | AC_DEFUN([_SEARCH_HIREDIS], 6 | [AC_REQUIRE([AX_CHECK_LIBRARY]) 7 | 8 | AS_IF([test "x$ac_enable_hiredis" = "xyes"], 9 | [hiredis_header="hiredis/hiredis.h"], 10 | [hiredis_header="does_not_exist"]) 11 | 12 | AX_CHECK_LIBRARY([HIREDIS],[$hiredis_header],[hiredis],, 13 | [AC_DEFINE([HAVE_HIREDIS],[0],[Define to 1 if HIREDIS is found])]) 14 | 15 | AS_IF([test "x$ax_cv_have_HIREDIS" = xno],[ac_enable_hiredis="no"]) 16 | ]) 17 | 18 | AC_DEFUN([AX_ENABLE_LIBHIREDIS], 19 | [AC_ARG_ENABLE([hiredis], 20 | [AS_HELP_STRING([--disable-hiredis], 21 | [Build with hiredis support @<:@default=on@:>@])], 22 | [ac_enable_hiredis="$enableval"], 23 | [ac_enable_hiredis="yes"]) 24 | 25 | _SEARCH_HIREDIS 26 | ]) 27 | -------------------------------------------------------------------------------- /m4/ax_append_to_file.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_append_to_file.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_APPEND_TO_FILE([FILE],[DATA]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Appends the specified data to the specified file. 12 | # 13 | # LICENSE 14 | # 15 | # Copyright (c) 2008 Tom Howard 16 | # 17 | # Copying and distribution of this file, with or without modification, are 18 | # permitted in any medium without royalty provided the copyright notice 19 | # and this notice are preserved. This file is offered as-is, without any 20 | # warranty. 21 | 22 | #serial 7 23 | 24 | AC_DEFUN([AX_APPEND_TO_FILE],[ 25 | AC_REQUIRE([AX_FILE_ESCAPES]) 26 | printf "$2" >> "$1" 27 | ]) 28 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_string_t.rst: -------------------------------------------------------------------------------- 1 | ========================== 2 | Strings (gearman_string_t) 3 | ========================== 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:type:: gearman_string_t 12 | 13 | .. c:macro:: gearman_size(string) 14 | 15 | Returns the size of the string. 16 | 17 | .. c:macro:: gearman_c_str(string) 18 | 19 | Returns the C string representation. 20 | 21 | Compile and link with -lgearman. 22 | 23 | ----------- 24 | DESCRIPTION 25 | ----------- 26 | 27 | The :c:type:`gearman_string_t` is a simple type representing a "string". 28 | Once created :c:type:`gearman_string_t` are not mutable once created. They 29 | only point to the strings that define them and require no deallocation. 30 | 31 | -------- 32 | SEE ALSO 33 | -------- 34 | 35 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_log_fn.rst: -------------------------------------------------------------------------------- 1 | ================================= 2 | Logging callback (gearman_log_fn) 3 | ================================= 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:type:: gearman_log_fn 12 | 13 | 14 | ----------- 15 | DESCRIPTION 16 | ----------- 17 | 18 | :c:type:`gearman_log_fn` is defined as:: 19 | 20 | void (gearman_log_fn)(const char *line, gearman_verbose_t verbose, void *context) 21 | 22 | ------------ 23 | RETURN VALUE 24 | ------------ 25 | 26 | None 27 | 28 | ---- 29 | HOME 30 | ---- 31 | 32 | To find out more information please check: 33 | `https://gearman.org/gearmand/ `_ 34 | 35 | -------- 36 | SEE ALSO 37 | -------- 38 | 39 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_client_set_log_fn(3)` :manpage:`gearman_worker_set_log_fn(3)` 40 | 41 | 42 | -------------------------------------------------------------------------------- /m4/ax_file_escapes.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_file_escapes.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_FILE_ESCAPES 8 | # 9 | # DESCRIPTION 10 | # 11 | # Writes the specified data to the specified file. 12 | # 13 | # LICENSE 14 | # 15 | # Copyright (c) 2008 Tom Howard 16 | # 17 | # Copying and distribution of this file, with or without modification, are 18 | # permitted in any medium without royalty provided the copyright notice 19 | # and this notice are preserved. This file is offered as-is, without any 20 | # warranty. 21 | 22 | #serial 7 23 | 24 | AC_DEFUN([AX_FILE_ESCAPES],[ 25 | AX_DOLLAR="\$" 26 | AX_SRB="\\135" 27 | AX_SLB="\\133" 28 | AX_BS="\\\\" 29 | AX_DQ="\"" 30 | ]) 31 | -------------------------------------------------------------------------------- /libgearman-server/struct/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential 4 | 5 | noinst_HEADERS+= \ 6 | libgearman-server/struct/client.h \ 7 | libgearman-server/struct/connection_list.h \ 8 | libgearman-server/struct/function.h \ 9 | libgearman-server/struct/gearmand.h \ 10 | libgearman-server/struct/gearmand_con.h \ 11 | libgearman-server/struct/gearmand_thread.h \ 12 | libgearman-server/struct/io.h \ 13 | libgearman-server/struct/job.h \ 14 | libgearman-server/struct/packet.h \ 15 | libgearman-server/struct/port.h \ 16 | libgearman-server/struct/server.h \ 17 | libgearman-server/struct/thread.h \ 18 | libgearman-server/struct/worker.h 19 | -------------------------------------------------------------------------------- /tests/httpd.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | 13 | t_httpd_SOURCES= 14 | t_httpd_LDADD= 15 | 16 | t_httpd_SOURCES+= tests/httpd_test.cc 17 | 18 | t_httpd_LDADD+= $(CLIENT_LDADD) 19 | 20 | #check_PROGRAMS+= t/httpd 21 | noinst_PROGRAMS+= t/httpd 22 | 23 | test-httpd: t/httpd gearmand/gearmand 24 | @t/httpd 25 | 26 | gdb-httpd: t/httpd gearmand/gearmand 27 | @$(GDB_COMMAND) tests/httpd 28 | 29 | helgrind-httpd: t/httpd gearmand/gearmand 30 | @$(HELGRIND_COMMAND) t/httpd 31 | 32 | valgrind-httpd: t/httpd gearmand/gearmand 33 | @$(VALGRIND_COMMAND) t/httpd 34 | -------------------------------------------------------------------------------- /libgearman-server/plugins/protocol/http/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | noinst_HEADERS+= libgearman-server/plugins/protocol/http/protocol.h 13 | noinst_HEADERS+= libgearman-server/plugins/protocol/http/method.h 14 | noinst_HEADERS+= libgearman-server/plugins/protocol/http/response_codes.h 15 | 16 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/protocol/http/protocol.cc 17 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/protocol/http/response_codes.cc 18 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/protocol/http/method.cc 19 | -------------------------------------------------------------------------------- /GNUmakefile: -------------------------------------------------------------------------------- 1 | # vim:ft=make 2 | # 3 | _bootstrap_Makefile := $(wildcard [M]akefile) 4 | _bootstrap_config-status := $(wildcard config.status) 5 | 6 | ALL_RECURSIVE_TARGETS= 7 | 8 | ifeq ($(.DEFAULT_GOAL),Makefile) 9 | @rm Makefile 10 | endif 11 | 12 | ifneq ($(_bootstrap_Makefile),) 13 | include Makefile 14 | else 15 | ifneq ($(_bt_config-status),) 16 | $(srcdir)/config.status 17 | $(MAKE) $(AM_MAKEFLAGS) configure 18 | endif 19 | 20 | .DEFAULT_GOAL:= basic_build 21 | srcdir= . 22 | 23 | configure: bootstrap.sh 24 | @$(srcdir)/bootstrap.sh -a 25 | 26 | Makefile: configure 27 | @$(srcdir)/bootstrap.sh -c 28 | 29 | .PHONY: basic_build 30 | basic_build: Makefile 31 | @$(MAKE) $(AM_MAKEFLAGS) 32 | endif 33 | 34 | ALL_RECURSIVE_TARGETS+= $(AM_RECURSIVE_TARGETS) 35 | 36 | ifneq ($(word 2, $(MAKECMDGOALS)), ) 37 | ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), ) 38 | .NOTPARALLEL: 39 | endif 40 | endif 41 | -------------------------------------------------------------------------------- /tests/postgres.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | 13 | t_postgres_SOURCES= 14 | t_postgres_CXXFLAGS= 15 | t_postgres_LDADD= 16 | 17 | t_postgres_SOURCES+= tests/basic.cc 18 | t_postgres_SOURCES+= tests/postgres_test.cc 19 | 20 | t_postgres_LDADD+= ${CLIENT_LDADD} 21 | 22 | check_PROGRAMS += t/postgres 23 | noinst_PROGRAMS += t/postgres 24 | 25 | test-postgres: t/postgres gearmand/gearmand 26 | @t/postgres 27 | 28 | gdb-postgres: t/postgres gearmand/gearmand 29 | @$(GDB_COMMAND) t/postgres 30 | 31 | valgrind-postgres: t/postgres gearmand/gearmand 32 | @$(VALGRIND_COMMAND) t/postgres 33 | -------------------------------------------------------------------------------- /m4/pandora_check_cxx_standard.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2009 Sun Microsystems, Inc. 2 | dnl This file is free software; Sun Microsystems, Inc. 3 | dnl gives unlimited permission to copy and/or distribute it, 4 | dnl with or without modifications, as long as this notice is preserved. 5 | 6 | AC_DEFUN([PANDORA_CHECK_CXX_STANDARD],[ 7 | dnl AC_REQUIRE([AC_CXX_COMPILE_STDCXX_0X]) 8 | AS_IF([test "$GCC" = "yes"], 9 | [AS_IF([test "$ac_cv_cxx_compile_cxx0x_native" = "yes"],[], 10 | [AS_IF([test "$ac_cv_cxx_compile_cxx0x_gxx" = "yes"], 11 | [CXX_STANDARD="-std=gnu++0x"], 12 | [CXX_STANDARD="-std=gnu++98"]) 13 | ]) 14 | ]) 15 | AM_CXXFLAGS="${CXX_STANDARD} ${AM_CXXFLAGS}" 16 | 17 | save_CXXFLAGS="${CXXFLAGS}" 18 | CXXFLAGS="${CXXFLAGS} ${CXX_STANDARD}" 19 | AC_CXX_HEADER_STDCXX_98 20 | CXXFLAGS="${save_CXXFLAGS}" 21 | 22 | AC_SUBST([CXX_STANDARD]) 23 | ]) 24 | -------------------------------------------------------------------------------- /docs/source/libgearman/examples.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | libgearman examples 3 | =================== 4 | 5 | 6 | ------------------------ 7 | Simple gearman_execute() 8 | ------------------------ 9 | 10 | The following examples shows how to use :c:func:`gearman_execute` to request data be sent to a function named "reverse" and print out the values. 11 | 12 | .. literalinclude:: examples/gearman_execute_example.c 13 | :language: c 14 | 15 | --------------------------------------- 16 | gearman_execute() with reducer function 17 | --------------------------------------- 18 | 19 | In this example we call the function count and tell it to map values using 20 | word_split. 21 | 22 | .. literalinclude:: examples/gearman_execute_partition.c 23 | :language: c 24 | 25 | 26 | -------------------------- 27 | Simple gearman_client_do() 28 | -------------------------- 29 | 30 | .. literalinclude:: examples/gearman_client_do_example.c 31 | :language: c 32 | -------------------------------------------------------------------------------- /tests/stress.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2012 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | 13 | t_stress_CFLAGS= 14 | t_stress_CXXFLAGS= 15 | t_stress_LDADD= 16 | t_stress_SOURCES= 17 | 18 | t_stress_SOURCES+= tests/burnin.cc 19 | t_stress_LDADD+= libgearman/libgearman.la 20 | t_stress_LDADD+= libtest/libtest.la 21 | t_stress_LDADD+= tests/libstartworker.la 22 | #check_PROGRAMS+=t/stress 23 | noinst_PROGRAMS+=t/stress 24 | 25 | test-stress: t/stress gearmand/gearmand 26 | @t/stress 27 | 28 | valgrind-stress: t/stress gearmand/gearmand 29 | @$(VALGRIND_COMMAND) t/stress 30 | 31 | gdb-stress: t/stress gearmand/gearmand 32 | @$(GDB_COMMAND) t/stress 33 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_client_wait.rst: -------------------------------------------------------------------------------- 1 | ================================= 2 | Sleeping until client is has I/O. 3 | ================================= 4 | 5 | 6 | -------- 7 | SYNOPSIS 8 | -------- 9 | 10 | #include 11 | 12 | .. c:function:: gearman_return_t gearman_client_wait(gearman_client_st *client) 13 | 14 | Link with -lgearman 15 | 16 | ----------- 17 | DESCRIPTION 18 | ----------- 19 | 20 | Calling :c:func:`gearman_client_wait` causes the calling code to sleep until either the timeout in :c:type:`gearman_client_st` is reached or :program:`gearmand` responds to the client. 21 | 22 | ------------ 23 | RETURN VALUE 24 | ------------ 25 | 26 | :c:type:`gearman_return_t` 27 | 28 | ---- 29 | HOME 30 | ---- 31 | 32 | To find out more information please check: 33 | `https://gearman.org/gearmand/ `_ 34 | 35 | 36 | -------- 37 | SEE ALSO 38 | -------- 39 | 40 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 41 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_worker_set_identifier.rst: -------------------------------------------------------------------------------- 1 | 2 | ============================= 3 | Setting a worker's identifier 4 | ============================= 5 | 6 | 7 | -------- 8 | SYNOPSIS 9 | -------- 10 | 11 | #include 12 | 13 | .. c:function:: gearman_return_t gearman_worker_set_identifier(gearman_worker_st *worker, const char *id, size_t id_size) 14 | 15 | Link with -lgearman 16 | 17 | ----------- 18 | DESCRIPTION 19 | ----------- 20 | 21 | :c:func:`gearman_worker_set_identifier` sets the identifier that the server uses to identify the worker. 22 | 23 | 24 | ------------ 25 | RETURN VALUE 26 | ------------ 27 | 28 | :c:func:`gearman_worker_set_identifier` return :c:type:`gearman_return_t`. 29 | 30 | ---- 31 | HOME 32 | ---- 33 | 34 | To find out more information please check: 35 | `https://gearman.org/gearmand/ `_ 36 | 37 | .. seealso:: :program:`gearmand` :doc:`../libgearman` :c:type:`gearman_worker_st` 38 | 39 | -------------------------------------------------------------------------------- /libgearman-server/plugins/queue/sqlite/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | noinst_HEADERS+= libgearman-server/plugins/queue/sqlite/queue.h 13 | noinst_HEADERS+= libgearman-server/plugins/queue/sqlite/instance.hpp 14 | 15 | if HAVE_LIBSQLITE3 16 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/queue/sqlite/queue.cc 17 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/queue/sqlite/instance.cc 18 | 19 | libgearman_server_libgearman_server_la_CFLAGS+= @SQLITE3_CFLAGS@ 20 | libgearman_server_libgearman_server_la_CXXFLAGS+= @SQLITE3_CFLAGS@ 21 | libgearman_server_libgearman_server_la_LIBADD+= @SQLITE3_LDFLAGS@ 22 | endif 23 | 24 | -------------------------------------------------------------------------------- /m4/pandora_with_r.m4: -------------------------------------------------------------------------------- 1 | dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*- 2 | dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 3 | dnl 4 | dnl pandora-build: A pedantic build system 5 | dnl Copyright (C) 2009 Sun Microsystems, Inc. 6 | dnl This file is free software; Sun Microsystems 7 | dnl gives unlimited permission to copy and/or distribute it, 8 | dnl with or without modifications, as long as this notice is preserved. 9 | dnl 10 | dnl From Monty Taylor 11 | 12 | AC_DEFUN([PANDORA_WITH_R],[ 13 | dnl Check for GNU R 14 | AC_ARG_WITH([r], 15 | [AS_HELP_STRING([--with-r], 16 | [Build R Bindings @<:@default=yes@:>@])], 17 | [with_r=$withval], 18 | [with_r=yes]) 19 | 20 | AS_IF([test "x$with_r" != "xno"],[ 21 | 22 | PKG_CHECK_MODULES([R], [libR], [ 23 | with_r=yes 24 | ],[ 25 | with_r=no 26 | ]) 27 | 28 | AC_SUBST(R_CFLAGS) 29 | AC_SUBST(R_LIBS) 30 | ]) 31 | AM_CONDITIONAL(BUILD_R, test "$with_r" = "yes") 32 | 33 | ]) 34 | -------------------------------------------------------------------------------- /docs/source/install.rst: -------------------------------------------------------------------------------- 1 | ========== 2 | Installing 3 | ========== 4 | 5 | -------------------------------- 6 | Compile and install from tarball 7 | -------------------------------- 8 | 9 | Download the latest tarball from the download page on Github (https://github.com/gearman/gearmand). 10 | 11 | Once downloaded, run:: 12 | tar xzf gearmand-X.Y.tar.gz 13 | ./configure 14 | make 15 | make install 16 | 17 | 18 | ------------------------------------------ 19 | Compile and install from source repository 20 | ------------------------------------------ 21 | 22 | The Bazaar version control system is required to check out the latest stable development source. To download and install, run:: 23 | bzr branch lp:gearmand 24 | cd gearmand 25 | ./config/autorun.sh 26 | ./configure 27 | make 28 | make install 29 | 30 | ----------------- 31 | Platform specifcs 32 | ----------------- 33 | .. toctree:: 34 | :maxdepth: 1 35 | 36 | build/ubuntu 37 | build/fedora 38 | build/centos5-8 39 | -------------------------------------------------------------------------------- /m4/ax_add_am_macro.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_add_am_macro.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_ADD_AM_MACRO([RULE]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Adds the specified rule to $AMINCLUDE. This macro will only work 12 | # properly with implementations of Make which allow include statements. 13 | # See also AX_ADD_AM_MACRO_STATIC. 14 | # 15 | # LICENSE 16 | # 17 | # Copyright (c) 2009 Tom Howard 18 | # 19 | # Copying and distribution of this file, with or without modification, are 20 | # permitted in any medium without royalty provided the copyright notice 21 | # and this notice are preserved. This file is offered as-is, without any 22 | # warranty. 23 | 24 | #serial 9 25 | 26 | AC_DEFUN([AX_ADD_AM_MACRO],[ 27 | AC_REQUIRE([AX_AM_MACROS]) 28 | AX_APPEND_TO_FILE([$AMINCLUDE],[$1]) 29 | ]) 30 | -------------------------------------------------------------------------------- /tests/ephemeral.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | 13 | t_ephemeral_SOURCES= 14 | t_ephemeral_CXXFLAGS= 15 | t_ephemeral_LDADD= ${CLIENT_LDADD} 16 | 17 | t_ephemeral_SOURCES+= tests/basic.cc 18 | t_ephemeral_SOURCES+= tests/ephemeral_test.cc 19 | 20 | check_PROGRAMS += t/ephemeral 21 | noinst_PROGRAMS += t/ephemeral 22 | 23 | test-ephemeral: t/ephemeral gearmand/gearmand 24 | @t/ephemeral 25 | 26 | gdb-ephemeral: t/ephemeral gearmand/gearmand 27 | @$(GDB_COMMAND) t/ephemeral 28 | 29 | helgrind-ephemeral: t/ephemeral gearmand/gearmand 30 | @$(HELGRIND_COMMAND) t/ephemeral 31 | 32 | valgrind-ephemeral: t/ephemeral gearmand/gearmand 33 | @$(VALGRIND_COMMAND) t/ephemeral 34 | -------------------------------------------------------------------------------- /libgearman-server/plugins/queue/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # All paths should be given relative to the root 10 | # 11 | 12 | noinst_HEADERS+= libgearman-server/plugins/queue/base.h 13 | 14 | libgearman_server_libgearman_server_la_SOURCES+= libgearman-server/plugins/queue/base.cc 15 | 16 | include libgearman-server/plugins/queue/default/include.am 17 | include libgearman-server/plugins/queue/drizzle/include.am 18 | include libgearman-server/plugins/queue/libmemcached/include.am 19 | include libgearman-server/plugins/queue/postgres/include.am 20 | include libgearman-server/plugins/queue/redis/include.am 21 | include libgearman-server/plugins/queue/sqlite/include.am 22 | include libgearman-server/plugins/queue/tokyocabinet/include.am 23 | include libgearman-server/plugins/queue/mysql/include.am 24 | -------------------------------------------------------------------------------- /tests/perl/worker/echo.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | #=============================================================================== 3 | # 4 | # FILE: echo.pl 5 | # 6 | # USAGE: ./echo.pl 7 | # 8 | # DESCRIPTION: Echo back the workload. 9 | # 10 | # OPTIONS: --- 11 | # REQUIREMENTS: --- 12 | # BUGS: --- 13 | # NOTES: --- 14 | # AUTHOR: YOUR NAME (), 15 | # ORGANIZATION: 16 | # VERSION: 1.0 17 | # CREATED: 07/11/2012 04:02:42 PM 18 | # REVISION: --- 19 | #=============================================================================== 20 | 21 | use Gearman::Worker; 22 | 23 | sub echo_worker 24 | { 25 | my $job = $_[0]; 26 | 27 | my $workload= $job->arg; 28 | 29 | return $workload; 30 | } 31 | 32 | use strict; 33 | use warnings; 34 | 35 | my $host = 'localhost'; 36 | my $port = '4730'; 37 | 38 | my $servers = $host . ':' . $port; 39 | 40 | my $worker = Gearman::Worker->new; 41 | $worker->job_servers($servers); 42 | $worker->register_function( 'echo', \&echo_worker); 43 | $worker->work while 1; 44 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_argument_t.rst: -------------------------------------------------------------------------------- 1 | ============================== 2 | Arguments (gearman_argument_t) 3 | ============================== 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:type:: gearman_argument_t 12 | 13 | .. c:function:: gearman_argument_t gearman_argument_make(const char *name, const size_t name_length, const char *value, const size_t value_size) 14 | 15 | Compile and link with -lgearman 16 | 17 | ----------- 18 | DESCRIPTION 19 | ----------- 20 | 21 | The :c:func:`gearman_argument_make` function initializes :c:type:`gearman_argument_t`. 22 | 23 | :c:type:`gearman_argument_t` is an abstraction used passing arguments too :c:func:`gearman_execute`. The arguments are not copied, so any object that is used to initialize :c:type:`gearman_argument_t` must continue to exist throughout the lifetime/usage of the structure. 24 | 25 | -------- 26 | SEE ALSO 27 | -------- 28 | 29 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_client_error()` or :manpage:`gearman_worker_error()` 30 | 31 | -------------------------------------------------------------------------------- /libtest/m4/mysql.m4: -------------------------------------------------------------------------------- 1 | m4_include([libtest/m4/ax_lib_mysql.m4]) 2 | m4_include([libtest/m4/ax_prog_mysqld.m4]) 3 | 4 | #serial 1 5 | 6 | AC_DEFUN([YATL_MYSQL], [ 7 | AC_REQUIRE([AX_PROG_MYSQLD]) 8 | 9 | AX_LIB_MYSQL([5.0]) 10 | AM_CONDITIONAL(HAVE_LIBMYSQL, test "x${found_mysql}" = "xyes") 11 | AS_IF([test "x${found_mysql}" = "xyes"],[ 12 | AC_DEFINE([HAVE_LIBMYSQL_BUILD], [1], [Define to 1 if MySQL libraries are available]) 13 | ],[ 14 | AC_DEFINE([HAVE_LIBMYSQL_BUILD], [0], [Define to 1 if MySQL libraries are available]) 15 | ]) 16 | 17 | AS_IF([test -f "$ac_cv_path_MYSQLD"],[ 18 | AC_DEFINE([HAVE_MYSQLD_BUILD], [1], [Define to 1 if MySQLD binary is available]) 19 | AC_DEFINE_UNQUOTED([MYSQLD_BINARY], "$ac_cv_path_MYSQLD", [Name of the mysqld binary used in make test]) 20 | ],[ 21 | AC_DEFINE([HAVE_MYSQLD_BUILD], [0], [Define to 1 if MySQLD binary is available]) 22 | AC_DEFINE([MYSQLD_BINARY], [0], [Name of the mysqld binary used in make test]) 23 | ]) 24 | ]) 25 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_job_handle_t.rst: -------------------------------------------------------------------------------- 1 | 2 | ================================= 3 | Job handle (gearman_job_handle_t) 4 | ================================= 5 | 6 | -------- 7 | SYNOPSIS 8 | -------- 9 | 10 | 11 | #include 12 | 13 | .. c:type:: gearman_job_handle_t 14 | 15 | ----------- 16 | DESCRIPTION 17 | ----------- 18 | 19 | A :c:type:`gearman_job_handle_t` represents a "job handle". A job handle is 20 | a text string that represents the name of a task (in truth 21 | gearman_job_handle_t is a typedef'ed 22 | char[:c:macro:`GEARMAN_JOB_HANDLE_SIZE`]). 23 | 24 | :c:func:`gearman_client_job_status` use handles to find the status of tasks. When passed to :c:func:`gearman_client_do_background` it will be populated with the job handle. 25 | 26 | ------------ 27 | RETURN VALUE 28 | ------------ 29 | 30 | None. 31 | 32 | ---- 33 | HOME 34 | ---- 35 | 36 | To find out more information please check: 37 | `https://gearman.org/gearmand/ `_ 38 | 39 | -------- 40 | SEE ALSO 41 | -------- 42 | 43 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` :c:type:`gearman_job_st` 44 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_parse_servers.rst: -------------------------------------------------------------------------------- 1 | ==================== 2 | Parsing server lists 3 | ==================== 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:type:: gearman_parse_server_fn 12 | 13 | .. c:function:: gearman_return_t gearman_parse_servers(const char *servers, gearman_parse_server_fn *function, void *context) 14 | 15 | Link with -lgearman 16 | 17 | ----------- 18 | DESCRIPTION 19 | ----------- 20 | 21 | :c:func:`gearman_parse_servers` parses a list of servers and call the :c:func:`gearman_parse_server_fn` for each server. 22 | 23 | ------------ 24 | RETURN VALUE 25 | ------------ 26 | 27 | A value of type :c:type:`gearman_return_t` is returned. 28 | On success that value will be :c:type:`GEARMAN_SUCCESS`. 29 | Use gearman_strerror to translate this value to a printable string. 30 | 31 | ---- 32 | HOME 33 | ---- 34 | 35 | 36 | To find out more information please check: 37 | `https://gearman.org/gearmand/ `_ 38 | 39 | 40 | -------- 41 | SEE ALSO 42 | -------- 43 | 44 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 45 | -------------------------------------------------------------------------------- /docs/source/libgearman/examples/gearman_client_do_example.c: -------------------------------------------------------------------------------- 1 | /* 2 | # Gearman server and library 3 | # Copyright (C) 2012 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in this directory for full text. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | int main(void) 15 | { 16 | gearman_client_st *client= gearman_client_create(NULL); 17 | 18 | gearman_return_t ret= gearman_client_add_server(client, "localhost", 0); 19 | if (gearman_failed(ret)) 20 | { 21 | return EXIT_FAILURE; 22 | } 23 | 24 | size_t result_size; 25 | gearman_return_t rc; 26 | void *value= gearman_client_do(client, "reverse_function", "unique_value", 27 | "my string to reverse", strlen("my string to reverse"), 28 | &result_size, &rc); 29 | 30 | if (gearman_success(rc)) 31 | { 32 | // Make use of value 33 | } 34 | free(value); 35 | 36 | gearman_client_free(client); 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /docker/testing/alpine/3.12/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG version=3.12 2 | FROM alpine:${version} 3 | 4 | ARG version 5 | ARG GEARMAN_REPO=https://github.com/gearman/gearmand 6 | 7 | LABEL description="Gearman Job Server Image (Alpine ${version})" 8 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 9 | LABEL version="${version}" 10 | 11 | # Install packages 12 | RUN apk add --no-cache \ 13 | make \ 14 | gcc \ 15 | g++ \ 16 | autoconf \ 17 | automake \ 18 | m4 \ 19 | git \ 20 | libtool \ 21 | bash \ 22 | file \ 23 | py3-sphinx \ 24 | util-linux-dev \ 25 | libuuid \ 26 | libevent-dev \ 27 | gperf \ 28 | boost-dev \ 29 | openssl-dev 30 | 31 | # Switch to a non-root user 32 | RUN adduser --disabled-password --shell /bin/bash gearman 33 | USER gearman 34 | 35 | # Clone the GitHub repository master branch 36 | RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git 37 | 38 | # Bootstrap, configure, make, and make test 39 | WORKDIR /tmp/gearmand 40 | RUN ./bootstrap.sh -a 41 | RUN ./configure --enable-ssl 2>&1 | tee ./configure.log 42 | RUN make 2>&1 | tee ./build.log 43 | RUN make test 2>&1 | tee ./test.log 44 | -------------------------------------------------------------------------------- /docker/testing/alpine/3.13/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG version=3.13 2 | FROM alpine:${version} 3 | 4 | ARG version 5 | ARG GEARMAN_REPO=https://github.com/gearman/gearmand 6 | 7 | LABEL description="Gearman Job Server Image (Alpine ${version})" 8 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 9 | LABEL version="${version}" 10 | 11 | # Install packages 12 | RUN apk add --no-cache \ 13 | make \ 14 | gcc \ 15 | g++ \ 16 | autoconf \ 17 | automake \ 18 | m4 \ 19 | git \ 20 | libtool \ 21 | bash \ 22 | file \ 23 | py3-sphinx \ 24 | util-linux-dev \ 25 | libuuid \ 26 | libevent-dev \ 27 | gperf \ 28 | boost-dev \ 29 | openssl-dev 30 | 31 | # Switch to a non-root user 32 | RUN adduser --disabled-password --shell /bin/bash gearman 33 | USER gearman 34 | 35 | # Clone the GitHub repository master branch 36 | RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git 37 | 38 | # Bootstrap, configure, make, and make test 39 | WORKDIR /tmp/gearmand 40 | RUN ./bootstrap.sh -a 41 | RUN ./configure --enable-ssl 2>&1 | tee ./configure.log 42 | RUN make 2>&1 | tee ./build.log 43 | RUN make test 2>&1 | tee ./test.log 44 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_client_error.rst: -------------------------------------------------------------------------------- 1 | 2 | ============================= 3 | Errors reported to the client 4 | ============================= 5 | 6 | -------- 7 | SYNOPSIS 8 | -------- 9 | 10 | #include 11 | 12 | .. c:function:: const char *gearman_client_error(const gearman_client_st *client) 13 | 14 | .. c:function:: int gearman_client_errno(gearman_client_st *client) 15 | 16 | Ling with -lgearman 17 | 18 | 19 | ----------- 20 | DESCRIPTION 21 | ----------- 22 | 23 | :c:func:`gearman_client_error` and :c:func:`gearman_client_errno` report on the last errors that the client reported/stored in :c:type:`gearman_client_st`. If you are interested in recording all errors please see :c:func:`gearman_client_set_log_fn`. 24 | 25 | ------------ 26 | RETURN VALUE 27 | ------------ 28 | 29 | :c:func:`gearman_client_errno` returns the last :manpage:`errno` that the client recorded. 30 | 31 | ---- 32 | HOME 33 | ---- 34 | 35 | To find out more information please check: 36 | `https://gearman.org/gearmand/ `_ 37 | 38 | .. seealso:: 39 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_worker_error.rst: -------------------------------------------------------------------------------- 1 | 2 | ============================= 3 | Errors returned to the worker 4 | ============================= 5 | 6 | -------- 7 | SYNOPSIS 8 | -------- 9 | 10 | #include 11 | 12 | .. c:function:: const char *gearman_worker_error(const gearman_worker_st *worker) 13 | 14 | .. c:function:: int gearman_worker_errno(gearman_worker_st *worker) 15 | 16 | Link with -lgearman 17 | 18 | 19 | ----------- 20 | DESCRIPTION 21 | ----------- 22 | 23 | :c:func:`gearman_worker_error` and :c:func:`gearman_worker_errno` report on the last errors that the worker reported/stored in :c:type:`gearman_worker_st`. If you are interested in recording all errors please see :c:func:`gearman_worker_set_log_fn`. 24 | 25 | ------------ 26 | RETURN VALUE 27 | ------------ 28 | 29 | :c:func:`gearman_worker_errno` returns the last :manpage:`errno` that the worker recorded. 30 | 31 | ---- 32 | HOME 33 | ---- 34 | 35 | To find out more information please check: 36 | `https://gearman.org/gearmand/ `_ 37 | 38 | 39 | .. seealso:: 40 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/source/gearmand/queues/mysql.rst: -------------------------------------------------------------------------------- 1 | ===== 2 | MySQL 3 | ===== 4 | 5 | 6 | The current schema, as of .21 is:: 7 | 8 | CREATE TABLE
( unique_key VARCHAR(GEARMAN_UNIQUE_SIZE), 9 | function_name VARCHAR(255), 10 | priority INT, 11 | data LONGBLOB, 12 | when_to_run BIGINT, 13 | unique key (unique_key, function_name)); 14 | 15 | The MySQL server communicates via the libdrizzle library. As of version 0.35 there is now a native MySQL queue that makes use of libmysql. 16 | 17 | To launch Gearman with MySQL support, you need to specify the following options:: 18 | 19 | gearmand --queue-type=MySQL \ 20 | --mysql-host=localhost \ 21 | --mysql-port=3306 \ 22 | --mysql-user=gearman \ 23 | --mysql-password=your_pw \ 24 | --mysql-db=gearman \ 25 | --mysql-table=gearman_queue 26 | 27 | You will need to make sure that the appropriate permissions are setup for the user that you use. Gearman will handle the creation of the table when it first starts up. 28 | -------------------------------------------------------------------------------- /docs/source/libgearman/namespace.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | Using namespaces 3 | ================ 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:function:: void gearman_client_set_namespace(gearman_client_st *self, const char *namespace_key, size_t namespace_key_size) 12 | 13 | .. c:function:: void gearman_worker_set_namespace(gearman_worker_st *self, const char *namespace_key, size_t namespace_key_size) 14 | 15 | Compile and link with -lgearman 16 | 17 | ----------- 18 | DESCRIPTION 19 | ----------- 20 | 21 | gearman_client_set_namespace() and gearman_worker_set_namespace() set 22 | a "namespace" for a given set of functions. Only clients and workers sharing 23 | a namespace_key can see one anothers workloads and functions. 24 | 25 | By setting namespace_key to NULL you can disable the namespace. 26 | 27 | ------ 28 | RETURN 29 | ------ 30 | 31 | None 32 | 33 | ---- 34 | HOME 35 | ---- 36 | 37 | To find out more information please check: 38 | `https://gearman.org/gearmand/ `_ 39 | 40 | 41 | -------- 42 | SEE ALSO 43 | -------- 44 | 45 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 46 | -------------------------------------------------------------------------------- /scripts/upstart/german-job-server.override: -------------------------------------------------------------------------------- 1 | description "Overriding gearman-job-server.conf" 2 | author "Goran Miskovic " 3 | # Useful info could be found in /var/log/upstart/gearman-job-server.log 4 | 5 | # Comment line bellow to enable starting job server on startup 6 | manual 7 | 8 | # For all versions of Upstart prior to v1.4, the default value for console was console none. 9 | # console log 10 | 11 | # Uncomment to change the default respawn limit 12 | # respawn the job up to 10 times within a 5 second period. 13 | # If the job exceeds these values, it will be stopped and marked as failed. 14 | # respawn limit 10 5 15 | 16 | # Uncomment to start when both mysql started and network is available 17 | # start on (started mysql and net-device-up IFACE!=lo) 18 | 19 | # If compiled from the source using default options gearmand will not be in /usr/sbin 20 | # exec /usr/local/sbin/gearmand 21 | 22 | # Uncomment to use configuration file that is not in the default location 23 | # exec /usr/local/sbin/gearmand --config-file=/path/tp/yours/gearmand.conf 24 | 25 | # Various options could be defined in the same way 26 | # exec /usr/local/sbin/gearmand --verbose=DEBUG -------------------------------------------------------------------------------- /m4/ax_endian.m4: -------------------------------------------------------------------------------- 1 | # https://github.com/BrianAker/ddm4 2 | # =========================================================================== 3 | # 4 | # SYNOPSIS 5 | # 6 | # AX_ENDIAN() 7 | # 8 | # DESCRIPTION 9 | # 10 | # Generate to defines describing endian. 11 | # 12 | # LICENSE 13 | # 14 | # Copyright (c) 2012 Brian Aker 15 | # 16 | # Copying and distribution of this file, with or without modification, are 17 | # permitted in any medium without royalty provided the copyright notice 18 | # and this notice are preserved. This file is offered as-is, without any 19 | # warranty. 20 | 21 | #serial 1 22 | 23 | AC_DEFUN([AX_ENDIAN],[ 24 | AC_C_BIGENDIAN([ 25 | AC_DEFINE([WORDS_BIGENDIAN],[1],[machine is big-endian]) 26 | AC_DEFINE([ENDIAN_BIG],[1],[machine is big-endian]) 27 | AC_DEFINE([ENDIAN_LITTLE],[0],[machine is little-endian])],[ 28 | ],[ 29 | AC_DEFINE([WORDS_BIGENDIAN],[0],[machine is big-endian]) 30 | AC_DEFINE([ENDIAN_BIG],[0],[machine is big-endian]) 31 | AC_DEFINE([ENDIAN_LITTLE],[1],[machine is little-endian]) 32 | ],[ 33 | AC_MSG_ERROR([unable to determine endian]) 34 | ]) 35 | ]) 36 | -------------------------------------------------------------------------------- /m4/ax_hex_version.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # https://github.com/BrianAker/ddm4 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_HEX_VERSION(VARIABLE_NAME, VERSION) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Generate version information in HEX and STRING format. 12 | # 13 | # LICENSE 14 | # 15 | # Copyright (c) 2012 Brian Aker 16 | # 17 | # Copying and distribution of this file, with or without modification, are 18 | # permitted in any medium without royalty provided the copyright notice 19 | # and this notice are preserved. This file is offered as-is, without any 20 | # warranty. 21 | 22 | #serial 3 23 | 24 | AC_DEFUN([AX_HEX_VERSION], 25 | [AC_PREREQ([2.63])dnl 26 | 27 | string_version_$1=`echo $2 | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "%d.%d.%d", $[]1, $[]2, $[]3}'` 28 | hex_version_$1=`echo $2 | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "0x%0.2d%0.3d%0.3d", $[]1, $[]2, $[]3}'` 29 | 30 | AC_SUBST([$1_VERSION_STRING],["$string_version_$1"]) 31 | AC_SUBST([$1_VERSION_HEX],["$hex_version_$1"]) 32 | ]) 33 | 34 | -------------------------------------------------------------------------------- /m4/pandora_stack_direction.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2009 Sun Microsystems 2 | dnl This file is free software; Sun Microsystems 3 | dnl gives unlimited permission to copy and/or distribute it, 4 | dnl with or without modifications, as long as this notice is preserved. 5 | 6 | #-------------------------------------------------------------------- 7 | # Check what direction the stack runs in 8 | #-------------------------------------------------------------------- 9 | 10 | AC_DEFUN([PANDORA_STACK_DIRECTION],[ 11 | AC_REQUIRE([AC_FUNC_ALLOCA]) 12 | AC_CACHE_CHECK([stack direction], [ac_cv_c_stack_direction],[ 13 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[ 14 | #include 15 | int find_stack_direction () 16 | { 17 | static char *addr = 0; 18 | auto char dummy; 19 | if (addr == 0) 20 | { 21 | addr = &dummy; 22 | return find_stack_direction (); 23 | } 24 | else 25 | return (&dummy > addr) ? 1 : -1; 26 | } 27 | ]],[[ 28 | exit (find_stack_direction() < 0); 29 | ]])],[ 30 | ac_cv_c_stack_direction=1 31 | ],[ 32 | ac_cv_c_stack_direction=-1 33 | ]) 34 | ]) 35 | AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) 36 | ]) 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /m4/pandora_use_pipe.m4: -------------------------------------------------------------------------------- 1 | dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*- 2 | dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 3 | dnl 4 | dnl pandora-build: A pedantic build system 5 | dnl Copyright (C) 2009 Sun Microsystems, Inc. 6 | dnl This file is free software; Sun Microsystem 7 | dnl gives unlimited permission to copy and/or distribute it, 8 | dnl with or without modifications, as long as this notice is preserved. 9 | dnl 10 | dnl From Monty Taylor 11 | dnl 12 | dnl Test if we can Use -pipe to avoid making temp files during the compile. 13 | dnl Should speed up compile on slower disks 14 | 15 | AC_DEFUN([PANDORA_USE_PIPE],[ 16 | 17 | AS_IF([test "$GCC" = "yes"],[ 18 | AC_CACHE_CHECK([for working -pipe], [pandora_cv_use_pipe], [ 19 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ 20 | #include 21 | 22 | int main(int argc, char** argv) 23 | { 24 | (void) argc; (void) argv; 25 | return 0; 26 | } 27 | ]])], 28 | [pandora_cv_use_pipe=yes], 29 | [pandora_cv_use_pipe=no]) 30 | ]) 31 | AS_IF([test "$pandora_cv_use_pipe" = "yes"],[ 32 | AM_CFLAGS="-pipe ${AM_CFLAGS}" 33 | AM_CXXFLAGS="-pipe ${AM_CXXFLAGS}" 34 | ]) 35 | ]) 36 | ]) 37 | -------------------------------------------------------------------------------- /tests/libmemcached.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | 13 | t_memcached_CXXFLAGS= 14 | t_memcached_SOURCES= 15 | t_memcached_LDADD= 16 | 17 | t_memcached_SOURCES+= tests/basic.cc 18 | t_memcached_SOURCES+= tests/memcached_test.cc 19 | t_memcached_LDADD+= libgearman/libgearman.la 20 | t_memcached_LDADD+= libtest/libtest.la 21 | t_memcached_LDADD+= tests/libstartworker.la 22 | 23 | if HAVE_LIBMEMCACHED 24 | 25 | t_memcached_CXXFLAGS+= $(LIBMEMCACHED_CFLAGS) 26 | t_memcached_LDADD+= $(LIBMEMCACHED_UTIL_LIB) 27 | 28 | endif 29 | 30 | check_PROGRAMS+= t/memcached 31 | noinst_PROGRAMS+= t/memcached 32 | 33 | test-libmemcached: t/memcached gearmand/gearmand 34 | @t/memcached 35 | 36 | valgrind-libmemcached: t/memcached gearmand/gearmand 37 | @$(VALGRIND_COMMAND) t/memcached 38 | 39 | gdb-libmemcached: t/memcached gearmand/gearmand 40 | @$(GDB_COMMAND) t/memcached 41 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_client_set_log_fn.rst: -------------------------------------------------------------------------------- 1 | =============== 2 | Logging Workers 3 | =============== 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:function:: void gearman_client_set_log_fn(gearman_worker_st *worker, gearman_log_fn *function, void *context, gearman_verbose_t verbose) 12 | 13 | ----------- 14 | DESCRIPTION 15 | ----------- 16 | 17 | :c:func:`gearman_client_set_log_fn` is similar to :c:func:`gearman_worker_set_log_fn` but it used with clients, aka, :c:type:`gearman_client_st`. 18 | :c:func:`gearman_client_set_log_fn` allows you to register a callback that will be passed all error messages that are givin to the client. 19 | 20 | See :c:type:`gearman_log_fn` for more information on the callback. 21 | 22 | See :c:type:`gearman_verbose_t` for more information on logging levels. 23 | 24 | ------------ 25 | RETURN VALUE 26 | ------------ 27 | 28 | None 29 | 30 | ---- 31 | HOME 32 | ---- 33 | 34 | To find out more information please check: 35 | `https://gearman.org/gearmand/ `_ 36 | 37 | -------- 38 | SEE ALSO 39 | -------- 40 | 41 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_log_fn(3)` 42 | 43 | -------------------------------------------------------------------------------- /m4/fcntl_flags.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2012 Data Differential LLC 2 | dnl Copyright (C) 2011 Keyur Govande 3 | dnl This file is free software; Keyur Govande 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl --------------------------------------------------------------------------- 7 | dnl Macro: FCNTL_FLAGS 8 | dnl --------------------------------------------------------------------------- 9 | 10 | AC_DEFUN([FCNTL_FLAGS], 11 | [ 12 | AC_CACHE_CHECK([for O_CLOEXEC], [ac_cv_o_cloexec], [ 13 | AC_LANG_PUSH([C]) 14 | save_CFLAGS="$CFLAGS" 15 | CFLAGS="$CFLAGS -I${srcdir}" 16 | 17 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [ int flags= O_CLOEXEC])], [ac_cv_o_cloexec="yes"], [ac_cv_o_cloexec="no"]) 18 | AC_LANG_POP 19 | CFLAGS="$save_CFLAGS" 20 | ]) 21 | 22 | AS_IF([test "x$ac_cv_o_cloexec" = "xyes"],[ AC_DEFINE(HAVE_O_CLOEXEC, 1, [Define to 1 if you have O_CLOEXEC defined])]) 23 | ]) 24 | 25 | dnl --------------------------------------------------------------------------- 26 | dnl End Macro: FCNTL_FLAGS 27 | dnl --------------------------------------------------------------------------- 28 | -------------------------------------------------------------------------------- /docker/example/supervisord/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | ARG version=1.0 4 | ARG timezone=America/New_York 5 | 6 | LABEL description="Supervisord Base Image for Gearmand" 7 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 8 | LABEL version="${version}" 9 | 10 | # Configure timezone 11 | ENV DEBIAN_FRONTEND=noninteractive \ 12 | TZ=${timezone} \ 13 | HOME=/root 14 | RUN echo $TZ > /etc/timezone 15 | 16 | # Install packages 17 | RUN apt-get update \ 18 | && apt-get -y upgrade \ 19 | && apt-get -y install \ 20 | supervisor \ 21 | tzdata \ 22 | && apt-get clean autoclean \ 23 | && apt-get -y autoremove \ 24 | && rm -rf /var/lib/apt/lists/* 25 | 26 | # Configure service 27 | RUN mkdir -p /var/log/supervisor \ 28 | && mkdir -p /var/run/supervisor \ 29 | && mkdir -p /etc/supervisor/conf.d 30 | 31 | COPY supervisord.conf /etc/supervisor/supervisord.conf 32 | 33 | RUN ln -s /etc/supervisor/supervisord.conf /etc/supervisord.conf \ 34 | && groupadd supervisor \ 35 | && chgrp supervisor /etc/supervisor/supervisord.conf \ 36 | && chmod 640 /etc/supervisor/supervisord.conf 37 | 38 | # Default command 39 | CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] 40 | -------------------------------------------------------------------------------- /tests/libdrizzle.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | 13 | t_drizzle_CXXFLAGS= 14 | t_drizzle_SOURCES= 15 | t_drizzle_LDADD= 16 | t_drizzle_LDFLAGS= 17 | 18 | t_drizzle_SOURCES+= tests/basic.cc 19 | t_drizzle_SOURCES+= tests/drizzle_test.cc 20 | 21 | t_drizzle_LDADD+= libgearman/libgearman.la 22 | t_drizzle_LDADD+= libtest/libtest.la 23 | t_drizzle_LDADD+= tests/libstartworker.la 24 | 25 | t_drizzle_LDFLAGS+= @LIBDRIZZLE_LDFLAGS@ 26 | t_drizzle_LDADD+= @LIBDRIZZLE_LIB@ 27 | 28 | check_PROGRAMS += t/drizzle 29 | noinst_PROGRAMS += t/drizzle 30 | 31 | test-drizzle: t/drizzle gearmand/gearmand 32 | @t/drizzle 33 | 34 | gdb-drizzle: t/drizzle gearmand/gearmand 35 | @$(GDB_COMMAND) t/drizzle 36 | 37 | helgrind-drizzle: t/drizzle gearmand/gearmand 38 | @$(HELGRIND_COMMAND) t/drizzle 39 | 40 | valgrind-drizzle: t/drizzle gearmand/gearmand 41 | @$(VALGRIND_COMMAND) t/drizzle 42 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_client_echo.rst: -------------------------------------------------------------------------------- 1 | 2 | =========================== 3 | Testing Clients and Workers 4 | =========================== 5 | 6 | -------- 7 | SYNOPSIS 8 | -------- 9 | 10 | #include 11 | 12 | 13 | .. c:function:: gearman_return_t gearman_client_echo(gearman_client_st *client, const void *workload, size_t workload_size) 14 | 15 | .. c:function:: gearman_return_t gearman_worker_echo(gearman_worker_st *worker, const void *workload, size_t workload_size) 16 | 17 | ----------- 18 | DESCRIPTION 19 | ----------- 20 | 21 | :c:func:`gearman_client_echo` and :c:func:`gearman_worker_echo` send a message to a :program:`gearmand` server. The server will then respond with the message that it sent. These commands are just for testing the connection to the servers that were configure for the :c:type:`gearman_client_st` and the :c:type:`gearman_worker_st` that were used. 22 | 23 | ------------ 24 | RETURN VALUE 25 | ------------ 26 | 27 | :c:type:`gearman_return_t` 28 | 29 | ---- 30 | HOME 31 | ---- 32 | 33 | To find out more information please check: 34 | `https://gearman.org/gearmand/ `_ 35 | 36 | .. seealso:: 37 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 38 | 39 | -------------------------------------------------------------------------------- /tests/sqlite.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in the parent directory for full text. 8 | # 9 | # Included from Top Level Makefile.am 10 | # All paths should be given relative to the root 11 | # 12 | 13 | CLEANFILES+= tests/gearman.sql tests/gearman.sql-journal tests/gearmand.log* 14 | 15 | if HAVE_LIBSQLITE3 16 | t_sqlite_CFLAGS= 17 | t_sqlite_CXXFLAGS= 18 | t_sqlite_LDADD= 19 | t_sqlite_SOURCES= 20 | 21 | t_sqlite_CFLAGS+= @SQLITE3_CFLAGS@ 22 | t_sqlite_CXXFLAGS+= @SQLITE3_CFLAGS@ 23 | t_sqlite_LDADD+= @SQLITE3_LDFLAGS@ 24 | t_sqlite_SOURCES+= tests/basic.cc 25 | t_sqlite_SOURCES+= tests/sqlite_test.cc 26 | t_sqlite_LDADD+= $(CLIENT_LDADD) 27 | check_PROGRAMS+= t/sqlite 28 | noinst_PROGRAMS+= t/sqlite 29 | 30 | test-sqlite: t/sqlite gearmand/gearmand 31 | @t/sqlite 32 | 33 | gdb-sqlite: t/sqlite gearmand/gearmand 34 | @$(GDB_COMMAND) t/sqlite 35 | 36 | helgrind-sqlite: t/sqlite gearmand/gearmand 37 | @$(HELGRIND_COMMAND) t/sqlite 38 | 39 | valgrind-sqlite: t/sqlite gearmand/gearmand 40 | @$(VALGRIND_COMMAND) t/sqlite 41 | endif 42 | -------------------------------------------------------------------------------- /gearmand/connection.h: -------------------------------------------------------------------------------- 1 | /* Gearman server and library 2 | * Copyright (C) 2008 Brian Aker, Eric Day 3 | * All rights reserved. 4 | * 5 | * Use and distribution licensed under the BSD license. See 6 | * the COPYING file in the parent directory for full text. 7 | */ 8 | 9 | #ifndef __GEARMAN_CONNECTION_H__ 10 | #define __GEARMAN_CONNECTION_H__ 11 | 12 | #include 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | #define GEARMAN_CONNECTION_MAX_FDS 10 19 | 20 | typedef struct gearman_connection_st gearman_connection_st; 21 | 22 | struct gearman_connection_st { 23 | bool is_allocated; 24 | int fds[GEARMAN_CONNECTION_MAX_FDS]; 25 | gearman_connection_state state; 26 | struct event evfifo; 27 | gearman_server_st server; 28 | gearman_result_st result; 29 | }; 30 | 31 | gearman_connection_st *gearman_connection_create(gearman_connection_st *ptr); 32 | void gearman_connection_free(gearman_connection_st *ptr); 33 | gearman_connection_st *gearman_connection_clone(gearman_connection_st *clone, gearman_connection_st *ptr); 34 | bool gearman_connection_add_fd(gearman_connection_st *ptr, int fd); 35 | bool gearman_connection_buffered(gearman_connection_st *ptr); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* __GEARMAN_CONNECTION_H__ */ 42 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_worker_set_log_fn.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | Logging Clients and Workers 3 | =========================== 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:function:: void gearman_worker_set_log_fn(gearman_worker_st *worker, gearman_log_fn *function, void *context, gearman_verbose_t verbose) 12 | 13 | ----------- 14 | DESCRIPTION 15 | ----------- 16 | 17 | :c:func:`gearman_worker_set_log_fn` is similar to :c:func:`gearman_client_set_log_fn` but it used with workers, aka, :c:type:`gearman_worker_st`. 18 | :c:func:`gearman_worker_set_log_fn` allows you to register a callback that will be passed all error messages that are givin to the worker. 19 | 20 | See :c:type:`gearman_log_fn` for a description of the callback. 21 | 22 | See :c:type:`gearman_verbose_t` for more information on logging levels. 23 | 24 | ------------ 25 | RETURN VALUE 26 | ------------ 27 | 28 | None 29 | 30 | ---- 31 | HOME 32 | ---- 33 | 34 | To find out more information please check: 35 | `https://gearman.org/gearmand/ `_ 36 | 37 | -------- 38 | SEE ALSO 39 | -------- 40 | 41 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_client_set_log_fn(3)` :manpage:`gearman_log_fn` :manpage:`gearman_verbose_t` 42 | 43 | -------------------------------------------------------------------------------- /docs/source/libgearman/examples/gearman_client_do_background_example.c: -------------------------------------------------------------------------------- 1 | /* 2 | # Gearman server and library 3 | # Copyright (C) 2012 Data Differential, http://datadifferential.com/ 4 | # All rights reserved. 5 | # 6 | # Use and distribution licensed under the BSD license. See 7 | # the COPYING file in this directory for full text. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | int main(void) 16 | { 17 | gearman_client_st *client= gearman_client_create(NULL); 18 | 19 | gearman_return_t ret= gearman_client_add_server(client, "localhost", 0); 20 | if (gearman_failed(ret)) 21 | { 22 | return EXIT_FAILURE; 23 | } 24 | 25 | gearman_job_handle_t job_handle; 26 | gearman_return_t rc= gearman_client_do_background(client, 27 | "reverse_function", 28 | "unique_value", 29 | "my string to reverse", strlen("my string to reverse"), 30 | job_handle); 31 | 32 | if (gearman_success(rc)) 33 | { 34 | // Make use of value 35 | printf("%s\n", job_handle); 36 | } 37 | 38 | gearman_client_free(client); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_task_attr_t.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | Describing Workload (gearman_work_t) 3 | ==================================== 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:type:: gearman_work_t 12 | 13 | .. c:type:: gearman_job_priority_t 14 | 15 | .. c:function:: gearman_work_t gearman_work(gearman_job_priority_t priority) 16 | 17 | .. c:function:: gearman_work_t gearman_work_epoch(time_t epoch, gearman_job_priority_t priority) 18 | 19 | .. c:function:: gearman_work_t gearman_work_background(gearman_job_priority_t priority) 20 | 21 | Compile and link with -lgearman 22 | 23 | ----------- 24 | DESCRIPTION 25 | ----------- 26 | 27 | :c:type:`gearman_work_t` describe work for :c:func:`gearman_execute`. 28 | 29 | :c:func:`gearman_work` creates a :c:type:`gearman_work_t` with a priority. 30 | 31 | :c:func:`gearman_work_epoch` creates a :c:type:`gearman_work_t` which tells :c:func:`gearman_execute` to execute the workload at the time specified by epoch. 32 | 33 | :c:func:`gearman_work_background` creates a :c:type:`gearman_work_t` which tells :c:func:`gearman_execute` to execute the workload as a background job. 34 | 35 | -------- 36 | SEE ALSO 37 | -------- 38 | 39 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_execute()` 40 | -------------------------------------------------------------------------------- /m4/ax_lib_curl.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_lib_curl.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_LIB_CURL([VERSION],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Checks for minimum curl library version VERSION. If successfull executes 12 | # ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE. 13 | # 14 | # Defines CURL_LIBS and CURL_CFLAGS. 15 | # 16 | # A simple example: 17 | # 18 | # AX_LIB_CURL([7.19.4],,[ 19 | # AC_MSG_ERROR([Your system lacks of libcurl >= 7.19.4]) 20 | # ]) 21 | # 22 | # This macro is a rearranged version of AC_LIB_CURL from Akos Maroy. 23 | # 24 | # LICENSE 25 | # 26 | # Copyright (c) 2009 Francesco Salvestrini 27 | # 28 | # Copying and distribution of this file, with or without modification, are 29 | # permitted in any medium without royalty provided the copyright notice 30 | # and this notice are preserved. This file is offered as-is, without any 31 | # warranty. 32 | 33 | #serial 7 34 | 35 | AU_ALIAS([AC_CHECK_CURL], [AX_LIB_CURL]) 36 | AC_DEFUN([AX_LIB_CURL], [ 37 | AX_PATH_GENERIC([curl],[$1],'s/^libcurl\ \+//',[$2],[$3]) 38 | ]) 39 | -------------------------------------------------------------------------------- /gearmand/server_common.h: -------------------------------------------------------------------------------- 1 | /* Gearman server and library 2 | * Copyright (C) 2008 Brian Aker, Eric Day 3 | * All rights reserved. 4 | * 5 | * Use and distribution licensed under the BSD license. See 6 | * the COPYING file in the parent directory for full text. 7 | */ 8 | 9 | #ifndef __GEARMAN_SERVER_COMMON_H__ 10 | #define __GEARMAN_SERVER_COMMON_H__ 11 | 12 | #define GEARMAN_INTERNAL 1 13 | 14 | #include 15 | 16 | #ifdef HAVE_ASSERT_H 17 | #include 18 | #endif 19 | #ifdef HAVE_SYS_TYPES_H 20 | #include 21 | #endif 22 | #ifdef HAVE_SYS_SOCKET_H 23 | #include 24 | #endif 25 | #ifdef HAVE_NETDB_H 26 | #include 27 | #endif 28 | #ifdef HAVE_STRING_H 29 | #include 30 | #endif 31 | #ifdef HAVE_STDIO_H 32 | #include 33 | #endif 34 | #ifdef HAVE_ERRNO_H 35 | #include 36 | #endif 37 | #ifdef HAVE_UNISTD_H 38 | #include 39 | #endif 40 | #ifdef HAVE_SIGNAL_H 41 | #include 42 | #endif 43 | 44 | #include 45 | #ifdef HAVE_SYS_TIME_H 46 | #include 47 | #endif 48 | 49 | #ifdef HAVE_EVENT_H 50 | #include 51 | #endif 52 | 53 | #include "connection.h" 54 | 55 | #define SERVER_PORT "7003" 56 | #define MAX_MSG 100 57 | 58 | #define SUCCESS 0 59 | #define ERROR 1 60 | 61 | #endif /* __GEARMAN_SERVER_COMMON_H__ */ 62 | -------------------------------------------------------------------------------- /m4/pandora_have_libtokyocabinet.m4: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009 Sun Microsystems, Inc. 2 | # This file is free software; Sun Microsystems, Inc. 3 | # gives unlimited permission to copy and/or distribute it, 4 | # with or without modifications, as long as this notice is preserved. 5 | 6 | # Provides support for finding libtokyocabinet. 7 | # 8 | # serial 2 9 | 10 | AC_DEFUN([_PANDORA_SEARCH_LIBTOKYOCABINET], 11 | [AC_REQUIRE([AX_CHECK_LIBRARY]) 12 | 13 | AS_IF([test "x$ac_enable_libtokyocabinet" = "xyes"], 14 | [tokyocabinet_header="tcadb.h"], 15 | [tokyocabinet_header="does_not_exist"]) 16 | 17 | AX_CHECK_LIBRARY([TOKYOCABINET],[$tokyocabinet_header],[tokyocabinet],, 18 | [AC_DEFINE([HAVE_TOKYOCABINET],[0],[Define to 1 if TOKYOCABINET is found])]) 19 | 20 | AS_IF([test "x$ax_cv_have_TOKYOCABINET" = xno],[ac_enable_libtokyocabinet="no"]) 21 | ]) 22 | 23 | AC_DEFUN([PANDORA_HAVE_LIBTOKYOCABINET], 24 | [AC_ARG_ENABLE([libtokyocabinet], 25 | [AS_HELP_STRING([--disable-libtokyocabinet], 26 | [Build with libtokyocabinet support @<:@default=on@:>@])], 27 | [ac_enable_libtokyocabinet="$enableval"], 28 | [ac_enable_libtokyocabinet="yes"]) 29 | 30 | _PANDORA_SEARCH_LIBTOKYOCABINET 31 | AM_CONDITIONAL([HAVE_TOKYOCABINET],[test "x${ac_enable_libtokyocabinet}" = "xyes"]) 32 | ]) 33 | -------------------------------------------------------------------------------- /m4/pandora_have_gcc_atomics.m4: -------------------------------------------------------------------------------- 1 | dnl Copyright (C) 2009 Sun Microsystems, Inc. 2 | dnl This file is free software; Sun Microsystems, Inc. 3 | dnl gives unlimited permission to copy and/or distribute it, 4 | dnl with or without modifications, as long as this notice is preserved. 5 | 6 | #-------------------------------------------------------------------- 7 | # Check for GCC Atomic Support 8 | #-------------------------------------------------------------------- 9 | 10 | 11 | AC_DEFUN([PANDORA_HAVE_GCC_ATOMICS],[ 12 | 13 | AC_CACHE_CHECK( 14 | [whether the compiler provides atomic builtins], 15 | [ac_cv_gcc_atomic_builtins], 16 | [AC_LINK_IFELSE( 17 | [AC_LANG_PROGRAM([],[[ 18 | int foo= -10; int bar= 10; 19 | if (!__sync_fetch_and_add(&foo, bar) || foo) 20 | return -1; 21 | bar= __sync_lock_test_and_set(&foo, bar); 22 | if (bar || foo != 10) 23 | return -1; 24 | bar= __sync_val_compare_and_swap(&bar, foo, 15); 25 | if (bar) 26 | return -1; 27 | return 0; 28 | ]])], 29 | [ac_cv_gcc_atomic_builtins=yes], 30 | [ac_cv_gcc_atomic_builtins=no])]) 31 | 32 | AS_IF([test "x$ac_cv_gcc_atomic_builtins" = "xyes"],[ 33 | AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1, 34 | [Define to 1 if compiler provides atomic builtins.]) 35 | ]) 36 | 37 | ]) 38 | -------------------------------------------------------------------------------- /m4/ax_am_macros.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_am_macros.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_AM_MACROS 8 | # 9 | # DESCRIPTION 10 | # 11 | # Adds support for macros that create Make rules. You must manually add 12 | # the following line 13 | # 14 | # @INC_AMINCLUDE@ 15 | # 16 | # to your Makefile.in (or Makefile.am if you use Automake) files. 17 | # 18 | # LICENSE 19 | # 20 | # Copyright (c) 2009 Tom Howard 21 | # 22 | # Copying and distribution of this file, with or without modification, are 23 | # permitted in any medium without royalty provided the copyright notice 24 | # and this notice are preserved. This file is offered as-is, without any 25 | # warranty. 26 | 27 | #serial 9 28 | 29 | AC_DEFUN([AX_AM_MACROS], 30 | [ 31 | AC_MSG_NOTICE([adding automake macro support]) 32 | AMINCLUDE="aminclude.am" 33 | AC_SUBST(AMINCLUDE) 34 | AC_MSG_NOTICE([creating $AMINCLUDE]) 35 | AMINCLUDE_TIME=`date` 36 | AX_PRINT_TO_FILE([$AMINCLUDE],[[ 37 | # generated automatically by configure from AX_AUTOMAKE_MACROS 38 | # on $AMINCLUDE_TIME 39 | 40 | ]]) 41 | 42 | INC_AMINCLUDE="include \$(top_builddir)/$AMINCLUDE" 43 | AC_SUBST(INC_AMINCLUDE) 44 | ]) 45 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_client_run_tasks.rst: -------------------------------------------------------------------------------- 1 | ============= 2 | Running tasks 3 | ============= 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:function:: gearman_return_t gearman_client_run_tasks(gearman_client_st *client) 12 | 13 | Link with -lgearman 14 | 15 | ----------- 16 | DESCRIPTION 17 | ----------- 18 | 19 | :c:func:`gearman_client_run_tasks` executes one or more tasks that have 20 | been added via :c:func:`gearman_client_add_task`, 21 | :c:func:`gearman_client_add_task_status` or 22 | :c:func:`gearman_client_add_task_background`. 23 | 24 | :c:func:`gearman_client_run_tasks` can also be used with 25 | :c:func:`gearman_execute` if either non-blocking or background tasks were 26 | created with it. 27 | 28 | ------------ 29 | RETURN VALUE 30 | ------------ 31 | 32 | :c:type:`gearman_return_t` 33 | 34 | If :c:type:`GEARMAN_PAUSE` is returned one of the tasks has "paused" in 35 | order to give the caller an opportunity to take some actions (like read 36 | data, handle an exception, etc...). See :c:type:`gearman_task_st` for more 37 | information about the state of a task. 38 | 39 | ---- 40 | HOME 41 | ---- 42 | 43 | To find out more information please check: 44 | `https://gearman.org/gearmand/ `_ 45 | 46 | 47 | .. seealso:: 48 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 49 | -------------------------------------------------------------------------------- /docker/testing/centos/7/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG version=7 2 | FROM centos:${version} 3 | 4 | ARG version 5 | ARG GEARMAN_REPO=https://github.com/gearman/gearmand 6 | 7 | LABEL description="Gearman Job Server Image (CentOS ${version}/x86_64)" 8 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 9 | LABEL version="https://github.com/gearman/gearmand/tree/master CentOS ${version}/x86_64" 10 | 11 | # Install packages 12 | RUN yum install -y \ 13 | rpm-build \ 14 | make \ 15 | boost-devel \ 16 | boost-thread \ 17 | gcc-c++ \ 18 | gperf \ 19 | gperftools-devel \ 20 | libevent-devel \ 21 | libmemcached-devel \ 22 | memcached \ 23 | libuuid-devel \ 24 | openssl-devel \ 25 | sqlite-devel \ 26 | tokyocabinet-devel \ 27 | zlib-devel \ 28 | git \ 29 | libtool \ 30 | python-sphinx 31 | 32 | ### Not available: 33 | # libpq-devel \ 34 | # hiredis-devel \ 35 | # mariadb-connector-c-devel \ 36 | 37 | # Switch to a non-root user 38 | RUN adduser -M --shell /bin/bash gearman 39 | USER gearman 40 | 41 | # Clone the GitHub repository master branch 42 | RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git 43 | 44 | # Bootstrap, configure, make, and make test 45 | WORKDIR /tmp/gearmand 46 | RUN ./bootstrap.sh -a 47 | RUN ./configure --enable-ssl 2>&1 | tee ./configure.log 48 | RUN make 2>&1 | tee ./build.log 49 | RUN make test 2>&1 | tee ./test.log 50 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_verbose_t.rst: -------------------------------------------------------------------------------- 1 | =========================================== 2 | Verbose levels for logs (gearman_verbose_t) 3 | =========================================== 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:type:: gearman_verbose_t 12 | 13 | .. c:function:: const char *gearman_verbose_name(gearman_verbose_t verbose) 14 | 15 | Link with -lgearman 16 | 17 | ----------- 18 | DESCRIPTION 19 | ----------- 20 | 21 | :c:func:`gearman_verbose_name` takes a :c:type:`gearman_verbose_t` and returns a character representation of it. 22 | 23 | Possible values of :c:type:`gearman_verbose_t`: 24 | 25 | .. c:type:: GEARMAN_VERBOSE_FATAL 26 | 27 | Fatal errors. 28 | 29 | .. c:type:: GEARMAN_VERBOSE_ERROR 30 | 31 | All errors. 32 | 33 | .. c:type:: GEARMAN_VERBOSE_INFO 34 | 35 | General information state about any events. 36 | 37 | .. c:type:: GEARMAN_VERBOSE_DEBUG 38 | 39 | Information calls left in the code for debugging events. 40 | 41 | 42 | ------------ 43 | RETURN VALUE 44 | ------------ 45 | 46 | A character string representing the verbose leval. 47 | 48 | ---- 49 | HOME 50 | ---- 51 | 52 | To find out more information please check: 53 | `https://gearman.org/gearmand/ `_ 54 | 55 | 56 | -------- 57 | SEE ALSO 58 | -------- 59 | 60 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 61 | -------------------------------------------------------------------------------- /docker/testing/centos/7-32bit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG version=7 2 | FROM i386/centos:${version} 3 | 4 | ARG version 5 | ARG GEARMAN_REPO=https://github.com/gearman/gearmand 6 | 7 | LABEL description="Gearman Job Server Image (CentOS ${version}/i686/32-bit)" 8 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 9 | LABEL version="https://github.com/gearman/gearmand/tree/master CentOS ${version}/i686/32-bit" 10 | 11 | # Install packages 12 | RUN yum install -y \ 13 | rpm-build \ 14 | make \ 15 | boost-devel \ 16 | boost-thread \ 17 | gcc-c++ \ 18 | gperf \ 19 | gperftools-devel \ 20 | libevent-devel \ 21 | libmemcached-devel \ 22 | memcached \ 23 | libuuid-devel \ 24 | openssl-devel \ 25 | sqlite-devel \ 26 | tokyocabinet-devel \ 27 | zlib-devel \ 28 | git \ 29 | libtool \ 30 | python-sphinx 31 | 32 | ### Not available: 33 | # libpq-devel \ 34 | # hiredis-devel \ 35 | # mariadb-connector-c-devel \ 36 | 37 | # Switch to a non-root user 38 | RUN adduser -M --shell /bin/bash gearman 39 | USER gearman 40 | 41 | # Clone the GitHub repository master branch 42 | RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git 43 | 44 | # Bootstrap, configure, make, and make test 45 | WORKDIR /tmp/gearmand 46 | RUN ./bootstrap.sh -a 47 | RUN ./configure --enable-ssl 2>&1 | tee ./configure.log 48 | RUN make 2>&1 | tee ./build.log 49 | RUN make test 2>&1 | tee ./test.log 50 | -------------------------------------------------------------------------------- /docs/source/protocol/text.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | Gearmand TEXT Protocol 3 | ====================== 4 | 5 | Gearmand supports a very simple administrative protocol that is enabled on the same port used by GEAR. You can make use of it via the gearadmin tool. 6 | 7 | The following list represents the current list of commands supported. You can issue any of these by telneting to the port and typing them in. 8 | 9 | .. describe:: workers 10 | 11 | Return the status of all attached workers. 12 | 13 | .. describe:: status 14 | 15 | Return the status of all current jobs. 16 | 17 | .. describe:: cancel job 18 | 19 | Cancel a job that has been queued. 20 | 21 | .. describe:: show jobs 22 | 23 | Show all current job ids. 24 | 25 | .. describe:: show unique jobs 26 | 27 | List all of the unique job ids that the server currently is processesing or waiting to process. 28 | 29 | .. describe:: create 30 | 31 | Create a function (i.e. queue). 32 | 33 | .. describe:: drop 34 | 35 | Drop a function (i.e. queue). 36 | 37 | .. describe:: maxqueue 38 | 39 | Set maxqueue 40 | 41 | .. describe:: getpid 42 | 43 | Return the process id of the server. 44 | 45 | .. describe:: verbose 46 | 47 | Return the verbose level of the server. 48 | 49 | .. describe:: version 50 | 51 | Version number of server. 52 | 53 | .. describe:: prioritystatus 54 | 55 | Queued jobs status by priority. 56 | 57 | -------------------------------------------------------------------------------- /m4/pandora_with_python.m4: -------------------------------------------------------------------------------- 1 | dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*- 2 | dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 3 | dnl 4 | dnl pandora-build: A pedantic build system 5 | dnl Copyright (C) 2009 Sun Microsystems, Inc. 6 | dnl This file is free software; Sun Microsystems 7 | dnl gives unlimited permission to copy and/or distribute it, 8 | dnl with or without modifications, as long as this notice is preserved. 9 | dnl 10 | dnl From Monty Taylor 11 | 12 | 13 | AC_DEFUN([PANDORA_WITH_PYTHON], [ 14 | 15 | AC_ARG_WITH([python], 16 | [AS_HELP_STRING([--with-python], 17 | [Build Python Bindings @<:@default=yes@:>@])], 18 | [with_python=$withval 19 | python_requested=$withval 20 | ], 21 | [with_python=yes 22 | python_requested=no 23 | ]) 24 | 25 | AS_IF([test "x$with_python" != "xno"],[ 26 | AS_IF([test "x$with_python" != "xyes"],[PYTHON=$with_python]) 27 | AM_PATH_PYTHON([2.4],,[with_python="no"]) 28 | AC_PYTHON_DEVEL() 29 | AS_IF([test "x$pythonexists" = "xno"],[with_python="no"]) 30 | ]) 31 | AS_IF([test "x$with_python" = "xno" -a "$python_requested" = "yes"],[ 32 | PANDORA_MSG_ERROR([Python support was explicity requested, but Python support 33 | was not found. Please correct your build environment and try 34 | again]) 35 | ]) 36 | AM_CONDITIONAL(BUILD_PYTHON, [test "$with_python" = "yes"]) 37 | ]) 38 | -------------------------------------------------------------------------------- /libhashkit-1.0/visibility.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Summary: interface for HashKit functions 3 | * Description: visibitliy macros for HashKit library 4 | * 5 | * Use and distribution licensed under the BSD license. See 6 | * the COPYING file in this directory for full text. 7 | * 8 | * Author: Monty Taylor 9 | */ 10 | 11 | /** 12 | * @file 13 | * @brief Visibility control macros 14 | */ 15 | 16 | #pragma once 17 | 18 | /** 19 | * 20 | * HASHKIT_API is used for the public API symbols. It either DLL imports or 21 | * DLL exports (or does nothing for static build). 22 | * 23 | * HASHKIT_LOCAL is used for non-api symbols. 24 | */ 25 | 26 | #if defined(BUILDING_HASHKIT) 27 | # if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY 28 | # define HASHKIT_API __attribute__ ((visibility("default"))) 29 | # define HASHKIT_LOCAL __attribute__ ((visibility("hidden"))) 30 | # elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550) 31 | # define HASHKIT_API __global 32 | # define HASHKIT_LOCAL __hidden 33 | # elif defined(_MSC_VER) 34 | # define HASHKIT_API extern __declspec(dllexport) 35 | # define HASHKIT_LOCAL 36 | # else 37 | # define HASHKIT_API 38 | # define HASHKIT_LOCAL 39 | # endif /* defined(HAVE_VISIBILITY) */ 40 | #else /* defined(BUILDING_HASHKIT) */ 41 | # if defined(_MSC_VER) 42 | # define HASHKIT_API extern __declspec(dllimport) 43 | # define HASHKIT_LOCAL 44 | # else 45 | # define HASHKIT_API 46 | # define HASHKIT_LOCAL 47 | # endif /* defined(_MSC_VER) */ 48 | #endif /* defined(BUILDING_HASHKIT) */ 49 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_allocator_t.rst: -------------------------------------------------------------------------------- 1 | ================================================ 2 | Defining custom allocators (gearman_allocator_t) 3 | ================================================ 4 | 5 | 6 | -------- 7 | SYNOPSIS 8 | -------- 9 | 10 | #include 11 | 12 | .. c:type:: gearman_allocator_t 13 | 14 | .. c:type:: gearman_malloc_fn 15 | 16 | .. c:type:: gearman_free_fn 17 | 18 | .. c:type:: gearman_realloc_fn 19 | 20 | .. c:type:: gearman_calloc_fn 21 | 22 | .. c:function:: gearman_return_t gearman_client_set_memory_allocators(gearman_client_st *, gearman_malloc_fn *malloc_fn, gearman_free_fn *free_fn, gearman_realloc_fn *realloc_fn, gearman_calloc_fn *calloc_fn, void *context) 23 | 24 | .. c:function:: gearman_return_t gearman_worker_set_memory_allocators(gearman_worker_st *, gearman_malloc_fn *malloc_fn, gearman_free_fn *free_fn, gearman_realloc_fn *realloc_fn, gearman_calloc_fn *calloc_fn, void *context) 25 | 26 | Link to -lgearman 27 | 28 | ----------- 29 | DESCRIPTION 30 | ----------- 31 | 32 | Install callbacks for custom allocation. 33 | 34 | Normally :manpage:`malloc(3)` and :manpage:`free(3)` are used for allocation and releasing workloads. You can use :c:func:`gearman_client_set_memory_allocators` and :c:func:`gearman_worker_set_memory_allocators` to set your own custom allocators. 35 | 36 | ------------ 37 | RETURN VALUE 38 | ------------ 39 | 40 | None 41 | 42 | .. seealso:: 43 | 44 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_client_st(3)` 45 | -------------------------------------------------------------------------------- /docker/testing/fedora/32/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG version=32 2 | FROM fedora:${version} 3 | 4 | MAINTAINER gearmand 5 | 6 | ARG version 7 | ARG GEARMAN_REPO=https://github.com/gearman/gearmand 8 | 9 | LABEL description="Gearman Job Server Image (Fedora ${version})" 10 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 11 | LABEL version="https://github.com/gearman/gearmand/tree/master Fedora ${version}" 12 | 13 | # Install packages 14 | RUN dnf makecache \ 15 | && dnf update -y \ 16 | && dnf install -y \ 17 | rpm-build \ 18 | git \ 19 | libtool \ 20 | autoconf \ 21 | automake \ 22 | make \ 23 | gettext-devel \ 24 | boost-devel \ 25 | boost-thread \ 26 | chrpath \ 27 | gcc-c++ \ 28 | gperf \ 29 | gperftools-devel \ 30 | hiredis-devel \ 31 | libevent-devel \ 32 | libmemcached-devel \ 33 | libpq-devel \ 34 | libuuid-devel \ 35 | mariadb-connector-c-devel \ 36 | memcached \ 37 | openssl-devel \ 38 | sqlite-devel \ 39 | tokyocabinet-devel \ 40 | zlib-devel \ 41 | python3-sphinx \ 42 | && dnf clean all \ 43 | && rm -rf /var/cache/yum 44 | 45 | # Switch to a non-root user 46 | RUN adduser -M --shell /bin/bash gearman 47 | USER gearman 48 | 49 | # Clone the GitHub repository master branch 50 | RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git 51 | 52 | # Bootstrap, configure, make, and make test 53 | WORKDIR /tmp/gearmand 54 | RUN ./bootstrap.sh -a 55 | RUN ./configure --enable-ssl 2>&1 | tee ./configure.log 56 | RUN make 2>&1 | tee ./build.log 57 | RUN make test 2>&1 | tee ./test.log 58 | -------------------------------------------------------------------------------- /docker/testing/fedora/36/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG version=36 2 | FROM fedora:${version} 3 | 4 | MAINTAINER gearmand 5 | 6 | ARG version 7 | ARG GEARMAN_REPO=https://github.com/gearman/gearmand 8 | 9 | LABEL description="Gearman Job Server Image (Fedora ${version})" 10 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 11 | LABEL version="https://github.com/gearman/gearmand/tree/master Fedora ${version}" 12 | 13 | # Install packages 14 | RUN dnf makecache \ 15 | && dnf update -y \ 16 | && dnf install -y \ 17 | rpm-build \ 18 | git \ 19 | libtool \ 20 | autoconf \ 21 | automake \ 22 | make \ 23 | gettext-devel \ 24 | boost-devel \ 25 | boost-thread \ 26 | chrpath \ 27 | gcc-c++ \ 28 | gperf \ 29 | gperftools-devel \ 30 | hiredis-devel \ 31 | libevent-devel \ 32 | libmemcached-devel \ 33 | libpq-devel \ 34 | libuuid-devel \ 35 | mariadb-connector-c-devel \ 36 | memcached \ 37 | openssl-devel \ 38 | sqlite-devel \ 39 | tokyocabinet-devel \ 40 | zlib-devel \ 41 | python3-sphinx \ 42 | && dnf clean all \ 43 | && rm -rf /var/cache/yum 44 | 45 | # Switch to a non-root user 46 | RUN adduser -M --shell /bin/bash gearman 47 | USER gearman 48 | 49 | # Clone the GitHub repository master branch 50 | RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git 51 | 52 | # Bootstrap, configure, make, and make test 53 | WORKDIR /tmp/gearmand 54 | RUN ./bootstrap.sh -a 55 | RUN ./configure --enable-ssl 2>&1 | tee ./configure.log 56 | RUN make 2>&1 | tee ./build.log 57 | RUN make test 2>&1 | tee ./test.log 58 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/14.04/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG version=14.04 2 | FROM ubuntu:${version} 3 | 4 | ARG version 5 | ARG GEARMAN_REPO=https://github.com/gearman/gearmand 6 | 7 | LABEL description="Gearman Job Server Image (Ubuntu ${version})" 8 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 9 | LABEL version="https://github.com/gearman/gearmand/tree/master Ubuntu ${version}" 10 | 11 | # Configure environment 12 | ENV DEBIAN_FRONTEND=noninteractive \ 13 | HOME=/root 14 | 15 | # Install packages 16 | RUN apt-get update \ 17 | && apt-get -y upgrade \ 18 | && apt-get -y install \ 19 | automake \ 20 | autoconf \ 21 | libtool \ 22 | make \ 23 | curl \ 24 | gcc \ 25 | g++ \ 26 | git \ 27 | gperf \ 28 | libssl-dev \ 29 | libboost-all-dev \ 30 | libevent-dev \ 31 | libhiredis-dev \ 32 | libpq-dev \ 33 | libtokyocabinet-dev \ 34 | tcsh \ 35 | python3-sphinx \ 36 | uuid-dev \ 37 | wget \ 38 | && apt-get clean autoclean \ 39 | && apt-get -y autoremove \ 40 | && rm -rf /var/lib/apt/lists/* 41 | 42 | # Switch to a non-root user 43 | RUN adduser --no-create-home --disabled-password --gecos '' --shell /bin/bash gearman 44 | USER gearman 45 | 46 | # Clone the GitHub repository master branch 47 | ENV HOME=/tmp 48 | RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git 49 | 50 | # Bootstrap, configure, make, and make test 51 | WORKDIR /tmp/gearmand 52 | RUN ./bootstrap.sh -a 53 | RUN ./configure --enable-ssl 2>&1 | tee ./configure.log 54 | RUN make 2>&1 | tee ./build.log 55 | RUN make test 2>&1 | tee ./test.log 56 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG version=16.04 2 | FROM ubuntu:${version} 3 | 4 | ARG version 5 | ARG GEARMAN_REPO=https://github.com/gearman/gearmand 6 | 7 | LABEL description="Gearman Job Server Image (Ubuntu ${version})" 8 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 9 | LABEL version="https://github.com/gearman/gearmand/tree/master Ubuntu ${version}" 10 | 11 | # Configure environment 12 | ENV DEBIAN_FRONTEND=noninteractive \ 13 | HOME=/root 14 | 15 | # Install packages 16 | RUN apt-get update \ 17 | && apt-get -y upgrade \ 18 | && apt-get -y install \ 19 | automake \ 20 | autoconf \ 21 | libtool \ 22 | make \ 23 | curl \ 24 | gcc \ 25 | g++ \ 26 | git \ 27 | gperf \ 28 | libssl-dev \ 29 | libboost-all-dev \ 30 | libevent-dev \ 31 | libhiredis-dev \ 32 | libpq-dev \ 33 | libtokyocabinet-dev \ 34 | tcsh \ 35 | python3-sphinx \ 36 | uuid-dev \ 37 | wget \ 38 | && apt-get clean autoclean \ 39 | && apt-get -y autoremove \ 40 | && rm -rf /var/lib/apt/lists/* 41 | 42 | # Switch to a non-root user 43 | RUN adduser --no-create-home --disabled-password --gecos '' --shell /bin/bash gearman 44 | USER gearman 45 | 46 | # Clone the GitHub repository master branch 47 | ENV HOME=/tmp 48 | RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git 49 | 50 | # Bootstrap, configure, make, and make test 51 | WORKDIR /tmp/gearmand 52 | RUN ./bootstrap.sh -a 53 | RUN ./configure --enable-ssl 2>&1 | tee ./configure.log 54 | RUN make 2>&1 | tee ./build.log 55 | RUN make test 2>&1 | tee ./test.log 56 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_client_add_task_status.rst: -------------------------------------------------------------------------------- 1 | ================================================== 2 | Adding a task to monitor a previously created task 3 | ================================================== 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:function:: gearman_task_st *gearman_client_add_task_status(gearman_client_st *client, gearman_task_st *task, void *context, const char *job_handle, gearman_return_t *ret_ptr) 12 | 13 | Link with -lgearman 14 | 15 | ----------- 16 | DESCRIPTION 17 | ----------- 18 | 19 | :c:func:`gearman_client_add_task_status` creates a :c:type:`gearman_task_st` that can be used to monitor a previously created task. 20 | 21 | .. warning:: 22 | You may wish to avoid using :c:func:`gearman_client_add_task` with a 23 | stack based allocated :c:type:`gearman_task_st`. The most common issues related to ABI safety involve 24 | stack allocated structures. If you use a stack based :c:type:`gearman_task_st` you must free it with :c:func:`gearman_task_free`. 25 | 26 | ------------ 27 | RETURN VALUE 28 | ------------ 29 | 30 | The :c:type:`gearman_task_st` is created and a pointer to it is returned. On error NULL is returned and ret_ptr is set with a :c:type:`gearman_return_t`. 31 | 32 | ---- 33 | HOME 34 | ---- 35 | 36 | To find out more information please check: 37 | `https://gearman.org/gearmand/ `_ 38 | 39 | 40 | .. seealso:: 41 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_task_st(3)` 42 | 43 | 44 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_worker_add_function.rst: -------------------------------------------------------------------------------- 1 | ================================= 2 | Create a function with a callback 3 | ================================= 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:type:: gearman_worker_fn 12 | 13 | .. c:function:: gearman_return_t gearman_worker_add_function(gearman_worker_st *worker, const char *function_name, uint32_t timeout, gearman_worker_fn *function, void *context) 14 | 15 | Compile and link with -lgearman 16 | 17 | ----------- 18 | DESCRIPTION 19 | ----------- 20 | 21 | :c:func:`gearman_worker_add_function` adds function with a callback to a :c:type:`gearman_worker_st` . 22 | A :c:type:`gearman_job_st` is passed to the callback, it can be used to send messages to the client about the state of the work. 23 | 24 | The context provided will only be shared with the function created. 25 | 26 | To remove the function call :c:func:`gearman_worker_unregister`. 27 | 28 | 29 | ------------ 30 | RETURN VALUE 31 | ------------ 32 | 33 | 34 | :c:func:`gearman_worker_add_function` returns a :c:type:`gearman_return_t` with either :c:type:`GEARMAN_SUCCESS`, or an error. Additional information on the error can be found with :c:function::`gearman_worker_error` 35 | 36 | 37 | ---- 38 | HOME 39 | ---- 40 | 41 | 42 | To find out more information please check: 43 | `https://gearman.org/gearmand/ `_ 44 | 45 | 46 | -------- 47 | SEE ALSO 48 | -------- 49 | 50 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_worker_st(3)` 51 | -------------------------------------------------------------------------------- /docker/README-Docker.md: -------------------------------------------------------------------------------- 1 | gearmand Docker Images 2 | ====================== 3 | 4 | The Dockerfiles under the ```testing``` subdirectory are intended to be used to test building gearmand on various Linux distributions. They also quasi-document the prerequisite packages that need to be installed on these same Linux distributions in order to build gearmand from source. 5 | 6 | The ```example``` gearmand Docker image can be built like this: 7 | 8 | cd example/supervisord/ && make latest && cd ../gearmand/ && make latest 9 | 10 | The ```testing``` gearmand Docker images can be built like this, e.g.: 11 | 12 | cd testing/alpine/3.12.0 && make 13 | 14 | Using SSL 15 | --------- 16 | 17 | In order to use SSL with the ```example``` image, follow these steps before building the image using the above command: 18 | 19 | 1. Copy your certificate files to the ```gearmand``` subdirectory: 20 | 21 | cp /path/to/your/certificates/your-certificate-authority.pem example/gearmand/gearmand-ca.pem 22 | cp /path/to/your/certificates/gearmand.pem example/gearmand/gearmand.pem 23 | cp /path/to/your/certificates/gearmand.key example/gearmand/gearmand.key 24 | 25 | Or, better yet, use [Docker secrets](https://docs.docker.com/engine/swarm/secrets/). 26 | 27 | 2. Edit ```example/gearmand/Dockerfile``` and uncomment the line that copies these files to ```/var/lib/gearman/```. 28 | 29 | 3. Edit ```example/gearmand/gearmand.conf``` and uncomment the ```command``` line with the SSL-related arguments. Delete (or comment out) the ```command``` line on the next line in that file. 30 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/18.04/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG version=18.04 2 | FROM ubuntu:${version} 3 | 4 | ARG version 5 | ARG GEARMAN_REPO=https://github.com/gearman/gearmand 6 | 7 | LABEL description="Gearman Job Server Image (Ubuntu ${version}/gcc-8)" 8 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 9 | LABEL version="https://github.com/gearman/gearmand/tree/master Ubuntu ${version}/gcc-8" 10 | 11 | # Configure environment 12 | ENV DEBIAN_FRONTEND=noninteractive \ 13 | HOME=/root 14 | 15 | # Install packages 16 | RUN apt-get update \ 17 | && apt-get -y upgrade \ 18 | && apt-get -y install \ 19 | automake \ 20 | autoconf \ 21 | libtool \ 22 | make \ 23 | curl \ 24 | gcc-8 \ 25 | g++-8 \ 26 | git \ 27 | gperf \ 28 | libssl-dev \ 29 | libboost-all-dev \ 30 | libevent-dev \ 31 | libhiredis-dev \ 32 | libpq-dev \ 33 | libtokyocabinet-dev \ 34 | tcsh \ 35 | python3-sphinx \ 36 | uuid-dev \ 37 | wget \ 38 | && apt-get clean autoclean \ 39 | && apt-get -y autoremove \ 40 | && rm -rf /var/lib/apt/lists/* 41 | 42 | # Switch to a non-root user 43 | RUN adduser --no-create-home --disabled-password --gecos '' --shell /bin/bash gearman 44 | USER gearman 45 | 46 | # Clone the GitHub repository master branch 47 | ENV HOME=/tmp 48 | RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git 49 | 50 | # Bootstrap, configure, make, and make test 51 | WORKDIR /tmp/gearmand 52 | RUN ./bootstrap.sh -a 53 | RUN env CC=gcc-8 CXX=g++-8 ./configure --enable-ssl 2>&1 | tee ./configure.log 54 | RUN make 2>&1 | tee ./build.log 55 | RUN make test 2>&1 | tee ./test.log 56 | -------------------------------------------------------------------------------- /docker/testing/ubuntu/20.04/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG version=20.04 2 | FROM ubuntu:${version} 3 | 4 | ARG version 5 | ARG GEARMAN_REPO=https://github.com/gearman/gearmand 6 | 7 | LABEL description="Gearman Job Server Image (Ubuntu ${version}/gcc-9)" 8 | LABEL maintainer="Gearmand Developers https://github.com/gearman/gearmand" 9 | LABEL version="https://github.com/gearman/gearmand/tree/master Ubuntu ${version}/gcc-9" 10 | 11 | # Configure environment 12 | ENV DEBIAN_FRONTEND=noninteractive \ 13 | HOME=/root 14 | 15 | # Install packages 16 | RUN apt-get update \ 17 | && apt-get -y upgrade \ 18 | && apt-get -y install \ 19 | automake \ 20 | autoconf \ 21 | libtool \ 22 | make \ 23 | curl \ 24 | gcc-9 \ 25 | g++-9 \ 26 | git \ 27 | gperf \ 28 | libssl-dev \ 29 | libboost-all-dev \ 30 | libevent-dev \ 31 | libhiredis-dev \ 32 | libpq-dev \ 33 | libtokyocabinet-dev \ 34 | tcsh \ 35 | python3-sphinx \ 36 | uuid-dev \ 37 | wget \ 38 | && apt-get clean autoclean \ 39 | && apt-get -y autoremove \ 40 | && rm -rf /var/lib/apt/lists/* 41 | 42 | # Switch to a non-root user 43 | RUN adduser --no-create-home --disabled-password --gecos '' --shell /bin/bash gearman 44 | USER gearman 45 | 46 | # Clone the GitHub repository master branch 47 | ENV HOME=/tmp 48 | RUN cd /tmp && git clone --depth 1 --branch master ${GEARMAN_REPO}.git 49 | 50 | # Bootstrap, configure, make, and make test 51 | WORKDIR /tmp/gearmand 52 | RUN ./bootstrap.sh -a 53 | RUN env CC=gcc-9 CXX=g++-9 ./configure --enable-ssl 2>&1 | tee ./configure.log 54 | RUN make 2>&1 | tee ./build.log 55 | RUN make test 2>&1 | tee ./test.log 56 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_client_add_server.rst: -------------------------------------------------------------------------------- 1 | ============== 2 | Adding Servers 3 | ============== 4 | 5 | -------- 6 | SYNOPSIS 7 | -------- 8 | 9 | #include 10 | 11 | .. c:function:: gearman_return_t gearman_client_add_server(gearman_client_st *client, const char *host, in_port_t port) 12 | 13 | .. c:function:: gearman_return_t gearman_client_add_servers(gearman_client_st *client, const char *servers) 14 | 15 | .. c:function:: void gearman_client_remove_servers(gearman_client_st *client) 16 | 17 | ----------- 18 | DESCRIPTION 19 | ----------- 20 | 21 | :c:func:`gearman_client_add_server` will add an additional :program:`gearmand` server to the list of servers that the client will take work from. 22 | 23 | :c:func:`gearman_client_remove_servers` will remove all servers from the :c:type:`gearman_client_st`. 24 | 25 | :c:func:`gearman_client_add_servers` takes a list of :program:`gearmand` servers that will be parsed to provide servers for the client. The format for this is SERVER[:PORT][,SERVER[:PORT]]... 26 | 27 | Examples of this are:: 28 | 10.0.0.1,10.0.0.2,10.0.0.3 29 | localhost234,jobserver2.domain.com:7003,10.0.0.3 30 | 31 | 32 | ------------ 33 | RETURN VALUE 34 | ------------ 35 | 36 | :c:func:`gearman_client_add_server` and :c:func:`gearman_client_remove_servers` return :c:type:`gearman_return_t`. 37 | 38 | ---- 39 | HOME 40 | ---- 41 | 42 | To find out more information please check: 43 | `https://gearman.org/gearmand/ `_ 44 | 45 | .. seealso:: 46 | 47 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` :manpage:`gearman_client_st` 48 | -------------------------------------------------------------------------------- /docs/source/libgearman/workers.rst: -------------------------------------------------------------------------------- 1 | Worker Basics 2 | ************* 3 | 4 | Workers take "work" in the form of messages sent by clients to the server. Clients call workers via a call to a "function". Whether or not message content is provided to the "function" is entirely left to the design of the end user. Message content is limited to ~4gigs (though the practical size is based on the amount of memory available to the server, so this number is likely to be much smaller). 5 | 6 | The server takes the work sent to it, and then passes it along to the first available worker to process. The work then returns a response in a single message, or it sends the message as "chunks" to the client. Clients by default receive messages as a single reply, so no work is needed to support "chunked" replies. A worker does not have to send a message in response, it can just return whether or not the work was carried out. 7 | 8 | As of 0.32 the following are the responses from a worker that is supported: 9 | 10 | :c:type:`GEARMAN_SUCCESS` 11 | 12 | On success the client is sent the result, and the work is marked as successfully completed. 13 | 14 | :c:type:`GEARMAN_FAIL` 15 | 16 | Of fail the server will report to the client that an error occurred and the work will not be retried. No result will be sent to the client. 17 | 18 | :c:type:`GEARMAN_ERROR` 19 | 20 | On error the server will retry the work, until job retries occurs (ie gearmand --job-retries=#) 21 | 22 | :c:type:`GEARMAN_SHUTDOWN` 23 | 24 | A shutdown message causes gearman_worker_work exit from its loop. The client is sent :c:type:`GEARMAN_SUCCESS`, and the result is sent to the client. 25 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_worker_add_server.rst: -------------------------------------------------------------------------------- 1 | 2 | ============== 3 | Adding Servers 4 | ============== 5 | 6 | 7 | -------- 8 | SYNOPSIS 9 | -------- 10 | 11 | #include 12 | 13 | .. c:function:: gearman_return_t gearman_worker_add_server(gearman_worker_st *worker, const char *host, in_port_t port) 14 | 15 | .. c:function:: gearman_return_t gearman_worker_add_servers(gearman_worker_st *worker, const char *servers) 16 | 17 | .. c:function:: void gearman_worker_remove_servers(gearman_worker_st *worker) 18 | 19 | Link with -lgearman 20 | 21 | ----------- 22 | DESCRIPTION 23 | ----------- 24 | 25 | :c:func:`gearman_worker_add_server` will add an additional :program:`gearmand` server to the list of servers that the worker will take work from. 26 | 27 | :c:func:`gearman_worker_remove_servers` will remove all servers from the :c:type:`gearman_worker_st`. 28 | 29 | :c:func:`gearman_worker_add_servers` takes a list of :program:`gearmand` servers that will be parsed to provide servers for the worker. The format for this is SERVER[:PORT][,SERVER[:PORT]]... 30 | 31 | Examples of this are:: 32 | 33 | 10.0.0.1,10.0.0.2,10.0.0.3 34 | localhost234,jobserver2.domain.com:7003,10.0.0.3 35 | 36 | 37 | ------------ 38 | RETURN VALUE 39 | ------------ 40 | 41 | :c:func:`gearman_worker_add_server` and :c:func:`gearman_worker_remove_servers` return :c:type:`gearman_return_t`. 42 | 43 | ---- 44 | HOME 45 | ---- 46 | 47 | To find out more information please check: 48 | `https://gearman.org/gearmand/ `_ 49 | 50 | .. seealso:: :program:`gearmand` :doc:`../libgearman` :c:type:`gearman_worker_st` 51 | -------------------------------------------------------------------------------- /m4/pandora_with_python3.m4: -------------------------------------------------------------------------------- 1 | dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*- 2 | dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 3 | dnl 4 | dnl pandora-build: A pedantic build system 5 | dnl Copyright (C) 2009 Sun Microsystems, Inc. 6 | dnl This file is free software; Sun Microsystems 7 | dnl gives unlimited permission to copy and/or distribute it, 8 | dnl with or without modifications, as long as this notice is preserved. 9 | dnl 10 | dnl From Monty Taylor 11 | 12 | AC_DEFUN([PANDORA_WITH_PYTHON3], [ 13 | 14 | AC_REQUIRE([PANDORA_SWIG]) 15 | 16 | AC_ARG_WITH([python3], 17 | [AS_HELP_STRING([--with-python3], 18 | [Build Python3 Bindings @<:@default=yes@:>@])],[ 19 | with_python3=$withval 20 | python3_requested=$withval 21 | ],[ 22 | with_python3=yes 23 | python3_requested=no 24 | ]) 25 | 26 | AS_IF([test "x$ac_cv_swig_has_python3_" != "xyes"],[ 27 | with_python3=no 28 | ],[ 29 | AS_IF([test "x$with_python3" != "xno"],[ 30 | AS_IF([test "x$with_python3" != "xyes"], 31 | [PYTHON3=$with_python3],[ 32 | AC_PATH_PROG([PYTHON3],[python3],[no]) 33 | PANDORA_PYTHON3_DEVEL() 34 | AS_IF([test "x$python3exists" = "xno"],[with_python="no"]) 35 | ]) 36 | ]) 37 | ]) 38 | AS_IF([test "x$with_python3" = "xno" -a "$python3_requested" = "yes"],[ 39 | PANDORA_MSG_ERROR([Python3 support was explicity requested, but Python3 support 40 | was not found. Please correct your build environment and try 41 | again]) 42 | ]) 43 | AM_CONDITIONAL(BUILD_PYTHON3, [test "$with_python3" = "yes"]) 44 | ]) 45 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Gearman server and library 2 | Copyright (C) 2011 Data Differential, http://datadifferential.com/ 3 | Copyright (C) 2008 Brian Aker, Eric Day 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following disclaimer 15 | in the documentation and/or other materials provided with the 16 | distribution. 17 | 18 | * The names of its contributors may not be used to endorse or 19 | promote products derived from this software without specific prior 20 | written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 26 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 28 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /m4/ax_pthread_timedjoin_np.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http:// 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_PTHREAD_TIMEDJOIN_NP() 8 | # 9 | # DESCRIPTION 10 | # 11 | # Check for pthread_timedjoin_np support. 12 | # 13 | # LICENSE 14 | # 15 | # Copyright (c) 2012 Brian Aker 16 | # 17 | # Copying and distribution of this file, with or without modification, are 18 | # permitted in any medium without royalty provided the copyright notice 19 | # and this notice are preserved. This file is offered as-is, without any 20 | # warranty. 21 | 22 | #serial 6 23 | 24 | AC_DEFUN([AX_PTHREAD_TIMEDJOIN_NP], 25 | [AC_PREREQ([2.63])dnl 26 | AC_REQUIRE([AX_PTHREAD]) 27 | AC_CACHE_CHECK([check for pthread_timedjoin_np], [ax_cv_pthread_timedjoin_np], 28 | [AX_SAVE_FLAGS 29 | CFLAGS="$PTHREAD_CFLAGS" 30 | LIBS="$PTHREAD_LIBS" 31 | AC_LANG_PUSH([C]) 32 | AC_LINK_IFELSE( 33 | [AC_LANG_PROGRAM( 34 | [ 35 | #include 36 | #include 37 | ],[ 38 | pthread_t thread; 39 | pthread_timedjoin_np(thread, NULL, NULL); 40 | ])], 41 | [ax_cv_pthread_timedjoin_np=yes],[]) 42 | 43 | AC_LANG_POP 44 | AX_RESTORE_FLAGS 45 | ]) 46 | 47 | AS_IF([test "$ax_cv_pthread_timedjoin_np" = yes], 48 | [AC_DEFINE(HAVE_PTHREAD_TIMEDJOIN_NP,[1],[Define if pthread_timedjoin_np is present in pthread.h.])], 49 | [AC_DEFINE(HAVE_PTHREAD_TIMEDJOIN_NP,[0],[Define if pthread_timedjoin_np is present in pthread.h.])]) 50 | ]) 51 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | ===================================== 2 | Welcome to the Gearman documentation! 3 | ===================================== 4 | 5 | Gearman provides a generic application framework to farm out work to other 6 | machines or processes that are better suited to do the work. It allows you 7 | to do work in parallel, to load balance processing, and to call functions 8 | between languages. It can be used in a variety of applications, from 9 | high-availability web sites, to the transport of database replication events. 10 | 11 | 12 | ------------- 13 | Introduction: 14 | ------------- 15 | .. toctree:: 16 | :maxdepth: 1 17 | 18 | license 19 | install 20 | how_to_report_a_bug 21 | glossary 22 | architecture 23 | 24 | ------ 25 | Server 26 | ------ 27 | .. toctree:: 28 | :maxdepth: 1 29 | 30 | gearmand 31 | gearmand/queues 32 | gearmand/ssl 33 | 34 | ------------------ 35 | Command Line Tools 36 | ------------------ 37 | 38 | .. toctree:: 39 | :maxdepth: 1 40 | 41 | bin/gearman 42 | bin/gearadmin 43 | 44 | 45 | --------------------- 46 | C/C++ Client Library: 47 | --------------------- 48 | 49 | .. toctree:: 50 | :maxdepth: 1 51 | 52 | libgearman/index 53 | 54 | -------- 55 | Protocol 56 | -------- 57 | 58 | .. toctree:: 59 | :maxdepth: 1 60 | 61 | protocol/gear 62 | protocol/text 63 | 64 | ------------------- 65 | Version Information 66 | ------------------- 67 | 68 | .. toctree:: 69 | :maxdepth: 1 70 | 71 | changes 72 | 73 | 74 | .. toctree:: 75 | :hidden: 76 | 77 | libgearman 78 | 79 | ------------------ 80 | Indices and tables 81 | ------------------ 82 | 83 | * :ref:`genindex` 84 | * :ref:`search` 85 | 86 | -------------------------------------------------------------------------------- /m4/ax_switch_flags.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_switch_flags.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_SWITCH_FLAGS(newnamespace,[oldnamespace]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Switch common compilation flags from temporary variables between two 12 | # compilation namespace. 13 | # 14 | # Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS, 15 | # OBJCFLAGS. 16 | # 17 | # By default these flags are restored to a global (empty) namespace, but 18 | # user could restore from specific NAMESPACE by using 19 | # AX_RESTORE_FLAGS(NAMESPACE) macro. 20 | # 21 | # Typical usage is like: 22 | # 23 | # AX_SAVE_FLAGS(beginprogram) 24 | # CPPFLAGS="-Imypackagespath ${CPPFLAGS}" 25 | # AX_SWITCH_FLAGS(mypackage,beginprogram) 26 | # 27 | # LICENSE 28 | # 29 | # Copyright (c) 2009 Filippo Giunchedi 30 | # Copyright (c) 2011 Russ Allbery 31 | # Copyright (c) 2013 Bastien ROUCARIES 32 | # 33 | # Copying and distribution of this file, with or without modification, are 34 | # permitted in any medium without royalty provided the copyright notice 35 | # and this notice are preserved. This file is offered as-is, without any 36 | # warranty. 37 | 38 | #serial 2 39 | 40 | AC_DEFUN([AX_SWITCH_FLAGS], [ 41 | AC_REQUIRE(AX_SAVE_FLAGS) 42 | AC_REQUIRE(AX_RESTORE_FLAGS) 43 | AS_IF([test "X$1" = "X"], AC_MSG_ERROR(newnamespace is empty)] 44 | AX_SAVE_FLAGS($1[]) 45 | AX_RESTORE_FLAGS($2[]) 46 | ]) 47 | -------------------------------------------------------------------------------- /libgearman-1.0/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 4 | 5 | include libgearman-1.0/t/include.am 6 | 7 | nobase_include_HEADERS+= libgearman-1.0/cancel.h 8 | nobase_include_HEADERS+= libgearman-1.0/interface/client.h 9 | nobase_include_HEADERS+= libgearman-1.0/interface/status.h 10 | nobase_include_HEADERS+= libgearman-1.0/interface/task.h 11 | nobase_include_HEADERS+= libgearman-1.0/interface/worker.h 12 | nobase_include_HEADERS+= libgearman-1.0/interface/job.h 13 | nobase_include_HEADERS+= libgearman-1.0/status.h 14 | nobase_include_HEADERS+= \ 15 | libgearman-1.0/actions.h \ 16 | libgearman-1.0/aggregator.h \ 17 | libgearman-1.0/allocator.h \ 18 | libgearman-1.0/argument.h \ 19 | libgearman-1.0/client.h \ 20 | libgearman-1.0/client_callbacks.h \ 21 | libgearman-1.0/configure.h \ 22 | libgearman-1.0/connection.h \ 23 | libgearman-1.0/constants.h \ 24 | libgearman-1.0/core.h \ 25 | libgearman-1.0/execute.h \ 26 | libgearman-1.0/function.h \ 27 | libgearman-1.0/gearman.h \ 28 | libgearman-1.0/job.h \ 29 | libgearman-1.0/job_handle.h \ 30 | libgearman-1.0/kill.h \ 31 | libgearman-1.0/limits.h \ 32 | libgearman-1.0/ostream.hpp \ 33 | libgearman-1.0/parse.h \ 34 | libgearman-1.0/priority.h \ 35 | libgearman-1.0/protocol.h \ 36 | libgearman-1.0/result.h \ 37 | libgearman-1.0/return.h \ 38 | libgearman-1.0/signal.h \ 39 | libgearman-1.0/strerror.h \ 40 | libgearman-1.0/string.h \ 41 | libgearman-1.0/task.h \ 42 | libgearman-1.0/task_attr.h \ 43 | libgearman-1.0/util.h \ 44 | libgearman-1.0/version.h \ 45 | libgearman-1.0/visibility.h \ 46 | libgearman-1.0/worker.h 47 | -------------------------------------------------------------------------------- /m4/bottom.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([CONFIG_EXTRA], [ 2 | 3 | AH_TOP([ 4 | #pragma once 5 | 6 | /* _SYS_FEATURE_TESTS_H is Solaris, _FEATURES_H is GCC */ 7 | #if defined( _SYS_FEATURE_TESTS_H) || defined(_FEATURES_H) 8 | #error "You should include gear_config.h as your first include file" 9 | #endif 10 | 11 | ]) 12 | 13 | AH_BOTTOM([ 14 | 15 | /* This seems to be required for older compilers @note http://stackoverflow.com/questions/8132399/how-to-printf-uint64-t */ 16 | #ifndef __STDC_FORMAT_MACROS 17 | # define __STDC_FORMAT_MACROS 18 | #endif 19 | 20 | #if defined(__cplusplus) 21 | # include CINTTYPES_H 22 | #else 23 | # include 24 | #endif 25 | 26 | #if !defined(HAVE_ULONG) && !defined(__USE_MISC) 27 | # define HAVE_ULONG 1 28 | typedef unsigned long int ulong; 29 | #endif 30 | 31 | /* To hide the platform differences between MS Windows and Unix, I am 32 | * going to use the Microsoft way and #define the Microsoft-specific 33 | * functions to the unix way. Microsoft use a separate subsystem for sockets, 34 | * but Unix normally just use a filedescriptor on the same functions. It is 35 | * a lot easier to map back to the unix way with macros than going the other 36 | * way without side effect. 37 | */ 38 | #ifdef _WIN32 39 | #define random() rand() 40 | #define srandom(a) srand(a) 41 | #define get_socket_errno() WSAGetLastError() 42 | #else 43 | #define INVALID_SOCKET -1 44 | #define SOCKET_ERROR -1 45 | #define closesocket(a) close(a) 46 | #define get_socket_errno() errno 47 | #endif // _WIN32 48 | 49 | #ifndef HAVE_MSG_NOSIGNAL 50 | #define MSG_NOSIGNAL 0 51 | #endif // HAVE_MSG_NOSIGNAL 52 | 53 | #ifndef HAVE_MSG_DONTWAIT 54 | #define MSG_DONTWAIT 0 55 | #endif // HAVE_MSG_DONTWAIT 56 | 57 | #include "libboost/config/workaround.hpp" 58 | 59 | ]) 60 | 61 | ])dnl CONFIG_EXTRA 62 | -------------------------------------------------------------------------------- /docs/source/libgearman/gearman_worker_options.rst: -------------------------------------------------------------------------------- 1 | ============== 2 | Worker Options 3 | ============== 4 | 5 | 6 | -------- 7 | SYNOPSIS 8 | -------- 9 | 10 | #include 11 | 12 | .. c:type:: gearman_worker_options_t 13 | 14 | .. c:function:: gearman_worker_options_t gearman_worker_options(const gearman_worker_st *worker) 15 | 16 | .. c:function:: void gearman_worker_add_options(gearman_worker_st *worker, gearman_worker_options_t options) 17 | 18 | .. c:function:: void gearman_worker_remove_options(gearman_worker_st *worker, gearman_worker_options_t options) 19 | 20 | .. c:function:: void gearman_worker_set_options(gearman_worker_st *worker, gearman_worker_options_t options) 21 | 22 | .. deprecated:: 0.21 23 | 24 | 25 | ----------- 26 | DESCRIPTION 27 | ----------- 28 | 29 | :c:func:`gearman_worker_options` returns the :c:type:`gearman_worker_options_t` for :c:type:`gearman_worker_st`. You enable options via :c:func:`gearman_worker_add_options` and disable options via :c:func:`gearman_worker_remove_options`. 30 | 31 | 32 | 33 | The currently supported options are: 34 | 35 | .. c:type: GEARMAN_WORKER_NON_BLOCKING 36 | 37 | Enable non-block IO for the worker. 38 | 39 | .. c:type:: GEARMAN_WORKER_GRAB_UNIQ 40 | 41 | Only grab jobs that have been assigned unique values. This is useful for workers who only want to worker with background jobs. 42 | 43 | .. c:type:: GEARMAN_WORKER_TIMEOUT_RETURN 44 | 45 | Has a return timeout been set for the worker. 46 | 47 | ------------ 48 | RETURN VALUE 49 | ------------ 50 | 51 | Various 52 | 53 | ---- 54 | HOME 55 | ---- 56 | 57 | To find out more information please check: 58 | `https://gearman.org/gearmand/ `_ 59 | 60 | .. seealso:: 61 | 62 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 63 | 64 | -------------------------------------------------------------------------------- /docs/source/libgearman/examples/gearman_execute_partition.c: -------------------------------------------------------------------------------- 1 | /* 2 | Example code to show how to send a string to a function called "word_split", reduce 3 | each chunk with the function count, and then print the results. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int main(void) 12 | { 13 | gearman_client_st *client= gearman_client_create(NULL); 14 | 15 | gearman_return_t ret= gearman_client_add_server(client, "localhost", 0); 16 | if (gearman_failed(ret)) 17 | { 18 | return EXIT_FAILURE; 19 | } 20 | 21 | gearman_argument_t value= gearman_argument_make(0, 0, "this dog does not hunt", strlen("this dog does not hunt")); 22 | 23 | gearman_task_st *task= gearman_execute_by_partition(client, 24 | "word_split", strlen("word_split"), 25 | "count", strlen("count"), // function 26 | NULL, 0, // no unique value provided 27 | NULL, 28 | &value, 0); 29 | 30 | if (task == NULL) // If gearman_execute() can return NULL on error 31 | { 32 | fprintf(stderr, "Error: %s\n", gearman_client_error(client)); 33 | gearman_client_free(client); 34 | return EXIT_FAILURE; 35 | } 36 | 37 | // Make sure the task was run successfully 38 | if (gearman_success(gearman_task_return(task))) 39 | { 40 | // Make use of value 41 | gearman_result_st *result= gearman_task_result(task); 42 | printf("%.*s\n", (int)gearman_result_size(result), gearman_result_value(result)); 43 | } 44 | 45 | gearman_client_free(client); 46 | 47 | return EXIT_SUCCESS; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /libhostile/sync.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Data Differential's libhostle 4 | * 5 | * Copyright (C) 2014 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | #pragma once 38 | 39 | -------------------------------------------------------------------------------- /docs/source/gearmand/ssl.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | Using SSL with Gearman 3 | ====================== 4 | 5 | If you are not paying a certificate authority to generate a certificate for you, you will first need a certificate authority (CA) for gearmand: 6 | 7 | openssl req -config /etc/pki/tls/openssl.cnf -new -x509 -keyout gearmand-ca.key -out gearmand-ca.pem -days 3650 8 | 9 | echo "00" > gearmand.srl 10 | 11 | You then need to place your CA certificate into the directory from which the server will read it. 12 | 13 | Generate a server certificate for the server to use: 14 | 15 | openssl genrsa -out gearmand.key 1024 16 | 17 | openssl req -key gearmand.key -new -out gearmand.req 18 | 19 | openssl x509 -req -in gearmand.req -CA gearmand-ca.pem -CAkey gearmand-ca.key -CAserial gearmand.srl -out gearmand.pem 20 | 21 | Generate a client certificate for client/workers to use: 22 | 23 | openssl genrsa -out gearman.key 1024 24 | 25 | openssl req -key gearman.key -new -out gearman.req 26 | 27 | openssl x509 -req -in gearman.req -CA gearmand-ca.pem -CAkey gearmand-ca.key -CAserial gearmand.srl -out gearman.pem 28 | 29 | 30 | Caveats: 31 | 32 | 1. Make sure your gearmand was configured with '--enable-ssl'. You will likely need to compile from source. 33 | 34 | 2. Unless you want your server and client certificates to expire in 30 days (the default), you should add the arguments '-days X' to the 'open req' commands for generating those certificates, where X is the number of days after which your certificates will expire. It should be less than or equal to the number of days until the CA certificate expires (3650 in the commands above). 35 | 36 | 3. Make sure you specify different "Common Name" values when generating the certificates for the CA, server, and client. OpenSSL does not like them being the same. 37 | -------------------------------------------------------------------------------- /docs/source/glossary.rst: -------------------------------------------------------------------------------- 1 | .. _glossary: 2 | 3 | Glossary 4 | ======== 5 | 6 | 7 | .. glossary:: 8 | 9 | client 10 | A client submits work in the form of a task, :c:type:`gearman_task_st` to a Gearman server. Client are represented by :c:type:`gearman_client_st`. 11 | 12 | worker 13 | Responds to tasks that originate from a client. A Gearman server transports the requests. 14 | 15 | task 16 | Client requests, they are represented by :c:type:`gearman_task_st`. Each task is assigned a job handle, :c:type:`gearman_job_handle_t`, by the server. 17 | 18 | job 19 | A job represents a task once it is sent to worker. It is represented as :c:type:`gearman_job_st`. 20 | 21 | function 22 | A "subprogram" that takes a set of parameters and returns a result (or just just a status). Functions are defined for workers. 23 | 24 | reducer 25 | A function that takes a piece of data from mapper and returns a value that will be sent to an aggregator function. Any function can be a reducer. 26 | 27 | mapper 28 | Mapper functions take incoming data and "map" it out to hosts. The "map" typically is a function that splits up the incoming work. The function that receives the mapped work is the reducer. Work is collected from the reducer and given to an aggregator function. 29 | 30 | aggregator 31 | A function which takes data and compiles it into a single return value. Aggregator functions are defined by :c:type:`gearman_aggregator_fn`. 32 | 33 | context 34 | Context are user supplied variables/structures that can be attached to :c:type:`gearman_worker_st`, :c:type:`gearman_client_st`, :c:type:`gearman_task_st`, :c:type:`gearman_job_st`, and similar objects that are passed as opaque objects that the library will ignore (i.e. they are there for developers to use to store state). 35 | -------------------------------------------------------------------------------- /libhashkit/behavior.cc: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * HashKit library 4 | * 5 | * Copyright (C) 2009-2012 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | 38 | #include 39 | -------------------------------------------------------------------------------- /docs/source/libgearman/examples/gearman_execute_example.c: -------------------------------------------------------------------------------- 1 | /* 2 | Example code to show how to send a string to a function called "reverse" and print the results. 3 | */ 4 | 5 | /* 6 | # Gearman server and library 7 | # Copyright (C) 2012 Data Differential, http://datadifferential.com/ 8 | # All rights reserved. 9 | # 10 | # Use and distribution licensed under the BSD license. See 11 | # the COPYING file in this directory for full text. 12 | */ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | int main(void) 20 | { 21 | gearman_client_st *client= gearman_client_create(NULL); 22 | 23 | gearman_return_t ret= gearman_client_add_server(client, "localhost", 0); 24 | if (gearman_failed(ret)) 25 | { 26 | return EXIT_FAILURE; 27 | } 28 | 29 | gearman_argument_t value= gearman_argument_make(0, 0, "Reverse Me", strlen("Reverse Me")); 30 | 31 | gearman_task_st *task= gearman_execute(client, 32 | "reverse", strlen("reverse"), // function 33 | NULL, 0, // no unique value provided 34 | NULL, 35 | &value, 0); 36 | 37 | if (task == NULL) // If gearman_execute() can return NULL on error 38 | { 39 | fprintf(stderr, "Error: %s\n", gearman_client_error(client)); 40 | gearman_client_free(client); 41 | return EXIT_FAILURE; 42 | } 43 | 44 | // Make sure the task was run successfully 45 | if (gearman_success(gearman_task_return(task))) 46 | { 47 | // Make use of value 48 | gearman_result_st *result= gearman_task_result(task); 49 | printf("%.*s\n", (int)gearman_result_size(result), gearman_result_value(result)); 50 | } 51 | 52 | gearman_client_free(client); 53 | 54 | return EXIT_SUCCESS; 55 | } 56 | -------------------------------------------------------------------------------- /libgearman/string.cc: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Gearmand String 4 | * 5 | * Copyright (C) 2011 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | 38 | #include "gear_config.h" 39 | #include 40 | -------------------------------------------------------------------------------- /libhashkit/hashkit.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * HashKit library 4 | * 5 | * Copyright (C) 2011 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | 38 | #pragma once 39 | 40 | #include 41 | -------------------------------------------------------------------------------- /libhashkit/hashkitcon.h.in: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * HashKit library 4 | * 5 | * Copyright (C) 2012 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | 38 | #pragma once 39 | 40 | #include "@AUTOHEADER_FILE@" 41 | -------------------------------------------------------------------------------- /libhostile/close.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Data Differential's libhostle 4 | * 5 | * Copyright (C) 2013 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | #pragma once 38 | 39 | typedef int (close_fn)(int fd); 40 | -------------------------------------------------------------------------------- /docs/source/bin/gearadmin.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | Gearman Admin Tool 3 | ================== 4 | 5 | Run Administrative commands against a server. 6 | 7 | -------- 8 | SYNOPSIS 9 | -------- 10 | 11 | .. program:: gearadmin 12 | 13 | .. option:: --help 14 | 15 | Provice help about the program. 16 | 17 | .. option:: --create-function 18 | 19 | Create a function from the server. 20 | 21 | .. option:: -h [ --host ] arg (=localhost)i 22 | 23 | Connect to the host 24 | 25 | .. option:: -p [ --port ] arg (=4730) 26 | 27 | Port number or service to use for connection 28 | 29 | .. option:: --drop-function 30 | 31 | Drop a function from the server. 32 | 33 | .. option:: --server-version 34 | 35 | Fetch the version number for the server. 36 | 37 | .. option:: --server-verbose 38 | 39 | Fetch the verbose setting for the server. 40 | 41 | .. option:: --status 42 | 43 | Status for the server. 44 | 45 | .. option:: --workers 46 | 47 | Workers for the server. 48 | 49 | .. option:: --cancel-job 50 | 51 | Remove a given job from the server's queue. 52 | 53 | .. option:: --show-unique-jobs 54 | 55 | Show unique IDs of jobs on the server. 56 | 57 | .. option:: --show-jobs 58 | 59 | Show all jobs on the server. 60 | 61 | .. option:: --getpid 62 | 63 | Get Process ID for the server. 64 | 65 | .. option:: --priority-status 66 | 67 | Queued jobs status by priority. 68 | 69 | .. option:: -S [ --ssl ] 70 | 71 | Enable SSL connections. 72 | 73 | 74 | ----------- 75 | DESCRIPTION 76 | ----------- 77 | 78 | Command line tool for manipulating gearmand servers. 79 | 80 | ---- 81 | HOME 82 | ---- 83 | 84 | To find out more information please check: 85 | `https://gearman.org/gearmand/ `_ 86 | 87 | 88 | -------- 89 | SEE ALSO 90 | -------- 91 | 92 | :manpage:`gearmand(8)` :manpage:`libgearman(3)` 93 | 94 | -------------------------------------------------------------------------------- /libhostile/malloc.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Data Differential's libhostle 4 | * 5 | * Copyright (C) 2012 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | #pragma once 38 | 39 | typedef void *(malloc_fn)(size_t size); 40 | -------------------------------------------------------------------------------- /docs/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # included from Top Level Makefile.am 3 | # All paths should be given relative to the root 4 | 5 | EXTRA_DIST+= docs/Makefile 6 | EXTRA_DIST+= docs/make.bat 7 | EXTRA_DIST+= docs/source/conf.py* 8 | EXTRA_DIST+= docs/source/*.rst 9 | EXTRA_DIST+= docs/source/cc-symbol.png 10 | EXTRA_DIST+= docs/source/gearmand/*.rst 11 | EXTRA_DIST+= docs/source/gearmand/queues/*.rst 12 | EXTRA_DIST+= docs/source/libgearman/*.rst 13 | EXTRA_DIST+= docs/source/libgearman/errors/*.rst 14 | EXTRA_DIST+= docs/source/bin/*.rst 15 | EXTRA_DIST+= docs/source/build/*.rst 16 | EXTRA_DIST+= docs/source/protocol/*.rst 17 | 18 | noinst_PROGRAMS+= docs/source/libgearman/examples/gearman_client_do_background_example 19 | noinst_PROGRAMS+= docs/source/libgearman/examples/gearman_client_do_example 20 | noinst_PROGRAMS+= docs/source/libgearman/examples/gearman_execute_example 21 | noinst_PROGRAMS+= docs/source/libgearman/examples/gearman_execute_partition 22 | 23 | docs_source_libgearman_examples_gearman_execute_example_SOURCES= docs/source/libgearman/examples/gearman_execute_example.c 24 | docs_source_libgearman_examples_gearman_execute_example_LDADD= libgearman/libgearman.la 25 | 26 | docs_source_libgearman_examples_gearman_execute_partition_SOURCES= docs/source/libgearman/examples/gearman_execute_partition.c 27 | docs_source_libgearman_examples_gearman_execute_partition_LDADD= libgearman/libgearman.la 28 | 29 | docs_source_libgearman_examples_gearman_client_do_example_SOURCES= docs/source/libgearman/examples/gearman_client_do_example.c 30 | docs_source_libgearman_examples_gearman_client_do_example_LDADD= libgearman/libgearman.la 31 | 32 | docs_source_libgearman_examples_gearman_client_do_background_example_SOURCES= docs/source/libgearman/examples/gearman_client_do_background_example.c 33 | docs_source_libgearman_examples_gearman_client_do_background_example_LDADD= libgearman/libgearman.la 34 | 35 | -------------------------------------------------------------------------------- /libhostile/realloc.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Data Differential's libhostle 4 | * 5 | * Copyright (C) 2012 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | #pragma once 38 | 39 | typedef void *(realloc_fn)(void *ptr, size_t size); 40 | 41 | -------------------------------------------------------------------------------- /examples/include.am: -------------------------------------------------------------------------------- 1 | # vim:ft=automake 2 | # Gearman server and library 3 | # Copyright (C) 2008 Brian Aker, Eric Day 4 | # Copyright (C) 2009 Brian Aker, Eric Day, Monty Taylor 5 | # Copyright (C) 2011 Data Differential, http://datadifferential.com/ 6 | # All rights reserved. 7 | # 8 | # Use and distribution licensed under the BSD license. See 9 | # the COPYING file in the parent directory for full text. 10 | # 11 | # Included from Top Level Makefile.am 12 | # All paths should be given relative to the root 13 | 14 | EXAMPLES_LDADD= 15 | EXAMPLES_LDADD+= @BOOST_PROGRAM_OPTIONS_LIB@ 16 | EXAMPLES_LDADD+= libgearman/libgearman.la 17 | 18 | noinst_PROGRAMS+= \ 19 | examples/echo_client \ 20 | examples/echo_worker \ 21 | examples/reverse_client \ 22 | examples/reverse_client_bg \ 23 | examples/reverse_client_epoch \ 24 | examples/reverse_client_cb \ 25 | examples/reverse_worker \ 26 | examples/wc_worker 27 | 28 | examples_echo_client_SOURCES= examples/echo_client.cc 29 | examples_echo_client_LDADD= $(EXAMPLES_LDADD) 30 | 31 | examples_echo_worker_SOURCES= examples/echo_worker.cc 32 | examples_echo_worker_LDADD= $(EXAMPLES_LDADD) 33 | 34 | examples_reverse_client_SOURCES= examples/reverse_client.cc 35 | examples_reverse_client_LDADD= $(EXAMPLES_LDADD) 36 | 37 | examples_reverse_client_bg_SOURCES= examples/reverse_client_bg.cc 38 | examples_reverse_client_bg_LDADD= $(EXAMPLES_LDADD) 39 | 40 | examples_reverse_client_epoch_SOURCES= examples/reverse_client_epoch.cc 41 | examples_reverse_client_epoch_LDADD= $(EXAMPLES_LDADD) 42 | 43 | examples_reverse_client_cb_SOURCES= examples/reverse_client_cb.cc 44 | examples_reverse_client_cb_LDADD= $(EXAMPLES_LDADD) 45 | 46 | examples_reverse_worker_SOURCES= examples/reverse_worker.cc 47 | examples_reverse_worker_LDADD= $(EXAMPLES_LDADD) 48 | 49 | examples_wc_worker_SOURCES= examples/wc_worker.cc 50 | examples_wc_worker_LDADD= $(EXAMPLES_LDADD) 51 | -------------------------------------------------------------------------------- /libgearman/backtrace.hpp: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * libgearman client library. 4 | * 5 | * Copyright (C) 2012 Data Differential, http://datadifferential.com/ 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above 16 | * copyright notice, this list of conditions and the following disclaimer 17 | * in the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * The names of its contributors may not be used to endorse or 21 | * promote products derived from this software without specific prior 22 | * written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | */ 37 | 38 | #pragma once 39 | 40 | void custom_backtrace(void); 41 | -------------------------------------------------------------------------------- /libhostile/write.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Data Differential's libhostle 4 | * 5 | * Copyright (C) 2012 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | #pragma once 38 | 39 | typedef ssize_t (write_fn)(int fd, const void *buf, size_t count); 40 | -------------------------------------------------------------------------------- /libtest/binaries.cc: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Data Differential YATL (i.e. libtest) library 4 | * 5 | * Copyright (C) 2012 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | #include "libtest/yatlcon.h" 38 | 39 | namespace libtest { 40 | 41 | } 42 | -------------------------------------------------------------------------------- /libhostile/socket.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Data Differential's libhostle 4 | * 5 | * Copyright (C) 2013 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | #pragma once 38 | 39 | typedef int (socket_fn)(int domain, int type, int protocol); 40 | 41 | -------------------------------------------------------------------------------- /libtest/binaries.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Data Differential YATL (i.e. libtest) library 4 | * 5 | * Copyright (C) 2012 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | #pragma once 38 | 39 | namespace libtest { 40 | 41 | } // namespace libtest 42 | -------------------------------------------------------------------------------- /libgearman/pipe.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Gearmand client and server library. 4 | * 5 | * Copyright (C) 2012 Data Differential, http://datadifferential.com/ 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are 10 | * met: 11 | * 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * * Redistributions in binary form must reproduce the above 16 | * copyright notice, this list of conditions and the following disclaimer 17 | * in the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * * The names of its contributors may not be used to endorse or 21 | * promote products derived from this software without specific prior 22 | * written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | */ 37 | 38 | #pragma once 39 | 40 | bool setup_shutdown_pipe(int pipedes_[2]); 41 | -------------------------------------------------------------------------------- /libhostile/action.h: -------------------------------------------------------------------------------- 1 | /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 2 | * 3 | * Data Differential's libhostle 4 | * 5 | * Copyright (C) 2012 Data Differential, http://datadifferential.com/ 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * * Redistributions in binary form must reproduce the above 15 | * copyright notice, this list of conditions and the following disclaimer 16 | * in the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * * The names of its contributors may not be used to endorse or 20 | * promote products derived from this software without specific prior 21 | * written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | */ 36 | 37 | #pragma once 38 | 39 | enum action_t 40 | { 41 | CLOSE_SOCKET_RECV, 42 | CLOSE_SOCKET_SEND 43 | }; 44 | --------------------------------------------------------------------------------