push.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. return {
  2. summary = 'Push a message onto the Channel.',
  3. description = [[
  4. Pushes a message onto the Channel. The following types of data can be pushed: nil, boolean,
  5. number, string, and userdata. Tables should be serialized to strings.
  6. ]],
  7. arguments = {
  8. {
  9. name = 'message',
  10. type = '*',
  11. description = 'The message to push.'
  12. },
  13. {
  14. name = 'wait',
  15. type = 'number',
  16. default = 'false',
  17. description = [[
  18. How long to wait for the message to be popped, in seconds. `true` can be used to wait
  19. forever and `false` can be used to avoid waiting.
  20. ]]
  21. }
  22. },
  23. returns = {
  24. {
  25. name = 'id',
  26. type = 'number',
  27. description = 'The ID of the pushed message.'
  28. },
  29. {
  30. name = 'read',
  31. type = 'boolean',
  32. description = 'Whether the message was read by another thread before the wait timeout.'
  33. }
  34. },
  35. notes = 'Threads can get stuck forever waiting on Channel messages, so be careful.',
  36. related = {
  37. 'Channel:pop',
  38. 'Channel:hasRead'
  39. }
  40. }