Skip to content

Commit

Permalink
more updates for outcome rework
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudshift committed Mar 5, 2012
1 parent 4079943 commit 60b6fb6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
11 changes: 9 additions & 2 deletions cloudshift/data/Sqlite3Bucket.hx
Expand Up @@ -208,8 +208,15 @@ class Sqlite3Bucket<T> implements Bucket<T> {
}

public function delete(o:T):Outcome<String,T> {
var prm = Core.outcome();
deleteByOid(Data.oid(o)).deliver(prm.resolve);
var prm:Outcome<String,T> = Core.outcome();
deleteByOid(Data.oid(o)).deliver(function(e:Either<String,Int>) {
switch(e) {
case Right(i):
prm.resolve(Right(o));
case Left(err):
prm.resolve(Left(err));
}
});
return prm;
}

Expand Down
4 changes: 2 additions & 2 deletions usage/data/RemoteClient.hx
Expand Up @@ -8,7 +8,7 @@ using cloudshift.Mixin;
class RemoteClient {

public static function main(){
Data.store(REMOTESQLITE("http://localhost:8082/data")).good(function(store) {
Data.store(REMOTESQLITE("http://localhost:8082/data")).outcome(function(store) {
store.bucket("woot").outcome(function(woot) {

woot.where('name="lore"').outcome(function(recs) {
Expand All @@ -21,7 +21,7 @@ class RemoteClient {
});
});

store.hash("peeps").good(function(peeps) {
store.hash("peeps").outcome(function(peeps) {
peeps.set("me",{email:"lorena@ritchie.com",name:"lore",passwd:"and why not"})
.outcome(function(p) {
peeps.get("me").outcome(function(me) {
Expand Down
2 changes: 1 addition & 1 deletion usage/data/RemoteSource.hx
Expand Up @@ -9,7 +9,7 @@ class RemoteSource {

public static function main(){
Http.server().root("www").start({host:"localhost",port:8082}).outcome(function(http) {
Data.store(SQLITE("test.db")).good(function(store) {
Data.store(SQLITE("test.db")).outcome(function(store) {
store.bucket("woot").outcome(function(woot) {
woot.indexer("name",function(o:Dynamic) {
return o.name;
Expand Down

0 comments on commit 60b6fb6

Please sign in to comment.