examples.rst 798 B

12345678910111213141516171819202122232425262728293031
  1. ===================
  2. libgearman examples
  3. ===================
  4. ------------------------
  5. Simple gearman_execute()
  6. ------------------------
  7. 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.
  8. .. literalinclude:: examples/gearman_execute_example.c
  9. :language: c
  10. ---------------------------------------
  11. gearman_execute() with reducer function
  12. ---------------------------------------
  13. In this example we call the function count and tell it to map values using
  14. word_split.
  15. .. literalinclude:: examples/gearman_execute_partition.c
  16. :language: c
  17. --------------------------
  18. Simple gearman_client_do()
  19. --------------------------
  20. .. literalinclude:: examples/gearman_client_do_example.c
  21. :language: c