pop.lua 823 B

123456789101112131415161718192021222324252627282930
  1. return {
  2. summary = 'Pop a message from the Channel.',
  3. description = [[
  4. Pops a message from the Channel. If the Channel is empty, an optional timeout argument can be
  5. used to wait for a message, otherwise `nil` is returned.
  6. ]],
  7. arguments = {
  8. {
  9. name = 'wait',
  10. type = 'number',
  11. default = 'false',
  12. description = [[
  13. How long to wait for a message to be popped, in seconds. `true` can be used to wait forever
  14. and `false` can be used to avoid waiting.
  15. ]]
  16. }
  17. },
  18. returns = {
  19. {
  20. name = 'message',
  21. type = '*',
  22. description = 'The received message, or `nil` if nothing was received.'
  23. }
  24. },
  25. notes = 'Threads can get stuck forever waiting on Channel messages, so be careful.',
  26. related = {
  27. 'Channel:peek',
  28. 'Channel:push'
  29. }
  30. }