Skip to content

replace AddHandler with Listen #79

@marten-seemann

Description

@marten-seemann

@Stebalien suggested to replace the AddHandler (which gets passed a callback) with a Listen(... protocol.ID) function, returning a Listener, on which an Accept method could be called to accept streams.

This would be a more idiomatic approach, as it closely mirrors how net.Conns and streams are accepted. It would also move the go routine handling to the application, which is arguably the place where it belongs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/daysEstimated to take multiple days, but less than a weekexp/intermediatePrior experience is likely helpfulkind/architectureCore architecture of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions