2
0

peek.lua 722 B

1234567891011121314151617181920212223242526
  1. return {
  2. summary = 'Look at a message from the Channel without popping it.',
  3. description = [[
  4. Returns a message from the Channel without popping it from the queue. If the Channel is empty,
  5. `nil` is returned. This can be useful to determine if the Channel is empty.
  6. ]],
  7. arguments = {},
  8. returns = {
  9. {
  10. name = 'message',
  11. type = '*',
  12. description = 'The message, or `nil` if there is no message.'
  13. },
  14. {
  15. name = 'present',
  16. type = 'boolean',
  17. description = 'Whether a message was returned (use to detect nil).'
  18. }
  19. },
  20. notes = [[
  21. The second return value can be used to detect if a `nil` message is in the queue.
  22. ]],
  23. related = {
  24. 'Channel:pop'
  25. }
  26. }