uperl / AnyEvent-WebSocket-Client

WebSocket client for AnyEvent
9 stars 10 forks source link

add a way to unregister callbacks #32

Closed yanick closed 7 years ago

yanick commented 7 years ago

WARNING: this change might break the API. Before, there was some bits of code that were doing

$conn->on( each_message => sub { my $msg = pop } );

With this change, pop will gives the unregistering function, not the message...

Also, on was returning $self, but it was not documented or used.

yanick commented 7 years ago

Also, if you want, I could get all fancy schmaltzy and use Beam::Emitter for those callbacks... Just say the word, and I'll have a second PR ready within a few days (or hours, depending how I feel)

plicease commented 7 years ago

Cool thanks! I think the API "breakage" is okay, as I think I was only using pop internally. I will do some due diligence on reverse dependencies and my own code base to be sure.

plicease commented 7 years ago

I've merged this and released as 0.42_01. production release to follow.