/* async-block.vala
 * Heiher <admin@heiher.info>
 */

class ObjA : Object {

	public ObjA () {
		debug ("ObjA");
	}

	~ObjA () {
		debug ("~ObjA");
	}

	public async void func1 () {
	}

	public async void func2 () {
	}
}

int main (string[] args) {
	var main_loop = new MainLoop ();
	var a = new ObjA ();

	AsyncReadyCallback func2_handler = (obj, res) => {
			a.func2.end (res);	

			main_loop.quit ();
		};

	a.func1.begin ((obj, res) => {
			a.func1.end (res);
			
			a.func2.begin (func2_handler);
		});

	main_loop.run ();

	return 0;
}

