blob: 5fba81aa848812453700771d3b6e2834e00af9bc [file] [log] [blame]
// Copyright 2016 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:fidl/fidl.dart';
import 'package:lib.app.dart/app.dart';
import 'package:fidl_fuchsia_examples_hello/fidl.dart';
class _HelloImpl extends Hello {
final HelloBinding _binding = new HelloBinding();
void bind(InterfaceRequest<Hello> request) {
_binding.bind(this, request);
}
@override
void say(String request, void callback(String response)) {
callback((request == 'hello') ? 'hola from Dart!' : 'adios from Dart!');
}
}
void main(List<String> args) {
StartupContext context = new StartupContext.fromStartupInfo();
context.outgoingServices
.addServiceForName(new _HelloImpl().bind, Hello.$serviceName);
}