replace AddHandler with Listen #79
Labels
effort/days
Estimated to take multiple days, but less than a week
exp/intermediate
Prior experience is likely helpful
kind/architecture
Core architecture of project
@Stebalien suggested to replace the
AddHandler
(which gets passed a callback) with aListen(... protocol.ID)
function, returning aListener
, on which anAccept
method could be called to accept streams.This would be a more idiomatic approach, as it closely mirrors how
net.Conn
s and streams are accepted. It would also move the go routine handling to the application, which is arguably the place where it belongs.The text was updated successfully, but these errors were encountered: