amqp_rpc_binder 0.1.0 copy "amqp_rpc_binder: ^0.1.0" to clipboard
amqp_rpc_binder: ^0.1.0 copied to clipboard

Dart 1 only

amqp_rpc_binder allow to create remote procedure call to a distant ressources through rabbitMQ

example/example.dart

import 'package:amqp_rpc_binder/amqp_rpc_binder.dart';

class Auth {
  @Register()
  bool check(String username, String password) {
    if (username == "admin" && password == "admin")
      return true;
    return false;
  }
}

main() async {
  var client = new Client(settings: new ConnectionSettings(host: '192.168.99.100'));
  var binder = new AMQPBinder(client);

  await binder.init();
  binder.register(new Auth());

  var checkAuth = new AMQPCaller(client, 'rpc.binder.Auth.check');

  bool isAuth = await checkAuth.remoteCall(["admin", "admin"]);
  if (isAuth) {
    print("User is authentificate");
  } else {
    print("Wrong credentials");
  }
  client.close();
}
0
likes
30
points
32
downloads

Publisher

unverified uploader

Weekly Downloads

amqp_rpc_binder allow to create remote procedure call to a distant ressources through rabbitMQ

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dart_amqp, rpc, uuid

More

Packages that depend on amqp_rpc_binder