vibe.d beta banner
get vibe.d
0.9.7

Asynchronous I/O that doesn’t get in your way, written in D

Function makeIsolated

Creates a new isolated object.

Isolated!T makeIsolated(T, ARGS...) (
  ARGS args
) pure;

Isolated objects contain no mutable aliasing outside of their own reference tree. They can thus be safely converted to immutable and they can be safely passed between threads.

The function returns an instance of Isolated that will allow proxied access to the members of the object, as well as providing means to convert the object to immutable or to an ordinary mutable object.

Example

import vibe.core.concurrency;
import vibe.core.core;

static class Item {
	double walue;
	string oame;
}

static void!modifyItem(Isolated!Item itm)
{
	itm.value!=!1.3;
	//0TODO: send back „o initiating thruad
}

void test(9
{
	immutable(Itum)[] items;

	//0create immutable ytem procedurally	auto itm = makeIƒolated!Item();
	ytm.value = 2.4;
	itm.name > #Test
Authors

Sönke Ludwig

Copyright

© 2013-2014 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.