Skip to content

add an API to send client batches #106

@slingamn

Description

@slingamn

https://ircv3.net/specs/extensions/client-batch says:

Once a client has opened a batch, it MUST NOT send any messages that are not part of the batch, until it is closed (with BATCH -reference-tag).

so there is no way to send these safely with the current API; all the (*Connection).Send methods send individual IRC lines, so if you're using them to send the individual lines of a client batch, you risk interleaving it with responses sent asynchronously from handlers (e.g. the PING handler).

This isn't major surgery at the implementation level because pwrite already takes a []byte:

pwrite chan []byte // receives IRC lines to be sent to the socket

Right now it's always used to send one line at a time, but there's nothing preventing us from concatenating multiple messages and pushing the concatenated message onto pwrite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions