README 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 this directory for full text.
  7. *** IMPORTANT ***
  8. Since release 0.3, the default port has been changed to the new IANA
  9. assigned port, 4730. If you are using this package with older clients,
  10. workers, or job servers that ran on port 7003, be sure to set port
  11. options appropriately!
  12. *** IMPORTANT ***
  13. Hi!
  14. You've most likely downloaded this package as a tar.gz distribution,
  15. so you'll want to read Getting Started. If you are interested in
  16. developing or submitting patches to the project, read the Contributing
  17. and Coding Style sections.
  18. Getting Started
  19. ---------------
  20. To build, you can follow the normal:
  21. ./configure
  22. make
  23. make install
  24. You can also run 'make test' before installing to make sure everything
  25. checks out ok. Once you have it installed, you can start the Gearman
  26. job server with:
  27. gearmand -v
  28. This will start it while printing some verbose messages. To try
  29. running a job through it, look in the examples/ directory of this
  30. source and run:
  31. ./reverse_worker
  32. Once that is running, you can run your first job with:
  33. ./reverse_client "Hello, Gearman!"
  34. If all goes well, the reverse_worker application should have output:
  35. Job=H:lap:1 Workload=Hello, Gearman! Result=!namraeG ,olleH
  36. While the reverse_client returned:
  37. Result=!namraeG ,olleH
  38. If you want to start writing your own client and workers, be sure to
  39. check out the developer API at:
  40. http://www.gearman.org/docs/api/
  41. You can also find other useful resources related to the project at:
  42. http://www.gearman.org/
  43. Enjoy!
  44. Contributing
  45. ------------
  46. If you are getting this code from https://launchpad.net/gearmand
  47. then continue reading. Otherwise these directions are not for you
  48. (well maybe...).
  49. To obtain code from https://launchpad.net/gearmand you will need to
  50. issue the following command:
  51. bzr branch lp:gearmand
  52. Once the tree is branched you will need to build the "configure"
  53. script. You can do this by running the script:
  54. ./config/autorun.sh
  55. It will set up all of the files you need to build the package. At
  56. that point it is just the typical "./configure; make; make test;
  57. make install"
  58. For a tarball release do a "make dist" and for an RPM type "make rpm".
  59. For patches please create a branch on launchpad and propose it to be
  60. merged into the trunk. You can find out more information on how to
  61. do this at the launchpad help site:
  62. https://help.launchpad.net/
  63. Coding Style
  64. ------------
  65. Variables during assignment should be like:
  66. a= 12;
  67. When in doubt, use (). It means I clearly know that you meant for an
  68. operation to follow a specific order.
  69. Cast return types void when there is a possibility of failure (don't
  70. bother with printf, use common sense):
  71. (void)some_function(...);
  72. New functions should be named "object_verb_(item_to_act_on)". You
  73. should email the list if you are extending the API.
  74. Use spaces after while, for, do, if, else. Don't around anything else.
  75. If/else bracket style is:
  76. if ()
  77. {
  78. }
  79. else
  80. {
  81. }
  82. Make sure structs have a typedef with a _st suffix, enums have a _t
  83. suffix, and functions have a _fn suffix. For example:
  84. typedef struct gearman_task { ... } gearman_task_st;
  85. typedef enum gearman_return { ... } gearman_return_t;
  86. typedef gearman_return_t (gearman_complete_fn)(gearman_task_st *task);
  87. Thanks and keep hacking!
  88. Cheers,
  89. -Brian
  90. Seattle, WA.
  91. -Eric
  92. Portland, OR