Skip to content

Commit

Permalink
Merge pull request #62 from muzzammilshahid/rename-endpoint
Browse files Browse the repository at this point in the history
Rename endpoint to invocationHandler and to eventHandler
  • Loading branch information
muzzammilshahid authored Dec 20, 2024
2 parents 64ca6f4 + 6b1cf37 commit 4d7d7aa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/src/session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ class Session {

Future<Registration> register(
String procedure,
Result Function(Invocation invocation) endpoint, {
Result Function(Invocation invocation) invocationHandler, {
Map<String, dynamic>? options,
}) {
var register = msg.Register(_nextID, procedure, options: options);

var completer = Completer<Registration>();
_registerRequests[register.requestID] = RegisterRequest(completer, endpoint);
_registerRequests[register.requestID] = RegisterRequest(completer, invocationHandler);

_baseSession.send(_wampSession.sendMessage(register));

Expand Down Expand Up @@ -221,11 +221,12 @@ class Session {
return null;
}

Future<Subscription> subscribe(String topic, void Function(Event event) endpoint, {Map<String, dynamic>? options}) {
Future<Subscription> subscribe(String topic, void Function(Event event) eventHandler,
{Map<String, dynamic>? options}) {
var subscribe = msg.Subscribe(_nextID, topic, options: options);

var completer = Completer<Subscription>();
_subscribeRequests[subscribe.requestID] = SubscribeRequest(completer, endpoint);
_subscribeRequests[subscribe.requestID] = SubscribeRequest(completer, eventHandler);
_baseSession.send(_wampSession.sendMessage(subscribe));

return completer.future;
Expand Down

0 comments on commit 4d7d7aa

Please sign in to comment.