Skip to content

Commit

Permalink
Fix the Client API
Browse files Browse the repository at this point in the history
  • Loading branch information
Gene Gleyzer committed Jun 8, 2022
1 parent cfda10b commit 018520b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib_jsondb/src/main/x/jsondb/Client.x
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ service Client<Schema extends RootSchema>
}

@Override
<Result extends immutable Const> Result require(function Result(DBObject) test)
<Result extends immutable Const> Result require(function Result(DBObjectImpl) test)
{
Transaction tx = requireTransaction_("require()");
return outer.txManager.registerRequirement(tx.id_, info_.id, test);
Expand Down Expand Up @@ -2437,4 +2437,4 @@ service Client<Schema extends RootSchema>
}
}
}
}
}
15 changes: 9 additions & 6 deletions lib_jsondb/src/main/x/jsondb/TxManager.x
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ service TxManager<Schema extends RootSchema>(Catalog<Schema> catalog)
internalJsonSchema = catalog.internalJsonSchema;
}

typedef Client<Schema>.DBObjectImpl as DBObjectImpl;


// ----- properties ----------------------------------------------------------------------------

Expand Down Expand Up @@ -464,9 +466,9 @@ service TxManager<Schema extends RootSchema>(Catalog<Schema> catalog)
*/
static const Requirement<Result extends immutable Const>
(
Int dboId,
function Result(DBObject) test,
Result result,
Int dboId,
function Result(DBObjectImpl) test,
Result result,
);

/**
Expand Down Expand Up @@ -681,7 +683,7 @@ service TxManager<Schema extends RootSchema>(Catalog<Schema> catalog)
}
}

closeLog();
&result.thenDo(closeLog);
status = Disabled;

if (finalTermination())
Expand Down Expand Up @@ -808,7 +810,8 @@ service TxManager<Schema extends RootSchema>(Catalog<Schema> catalog)
* @param writeId the transaction id
* @param req the Requirement
*/
<Result extends immutable Const> Result registerRequirement(Int writeId, Int dboId, function Result(DBObject) test)
<Result extends immutable Const> Result
registerRequirement(Int writeId, Int dboId, function Result(DBObjectImpl) test)
{
checkEnabled();

Expand Down Expand Up @@ -3584,4 +3587,4 @@ service TxManager<Schema extends RootSchema>(Catalog<Schema> catalog)
{
return clientCache.reversed.add(client);
}
}
}

0 comments on commit 018520b

Please sign in to comment.