Skip to content

Commit

Permalink
remove receive without pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
HereAdvertise authored Jul 11, 2024
1 parent 8ec8cf4 commit 2e14009
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pgmoon/redbean.moon
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,7 @@ class RedbeanSocket
return nil, "timeout" unless events[@unix_socket]
return nil, "close" if events[@unix_socket] & CANREAD == 0
return unix.recv @unix_socket, size

buf = ""
while true
events = assert unix.poll @unix_socket: unix.POLLIN, @timeout
return nil, "timeout" unless events[@unix_socket]
if events[@unix_socket] & CANREAD == 0
break
else
buf = buf .. assert unix.recv @unix_socket, 4096
buf
""

close: =>
assert unix.close @unix_socket
Expand Down

0 comments on commit 2e14009

Please sign in to comment.