Skip to content

Commit

Permalink
Rename operations with 'connection' suffix...
Browse files Browse the repository at this point in the history
  • Loading branch information
InsertCreativityHere committed Sep 4, 2024
1 parent ffaf725 commit 42c7f8a
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 47 deletions.
4 changes: 2 additions & 2 deletions cpp/test/Ice/ami/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ allTests(TestHelper* helper, bool collocated)
results.push_back(s->get_future());
}
atomic_flag sent = ATOMIC_FLAG_INIT;
p->closeAsync(nullptr, nullptr, [&sent](bool) { sent.test_and_set(); });
p->closeConnectionAsync(nullptr, nullptr, [&sent](bool) { sent.test_and_set(); });
if (!sent.test_and_set())
{
for (int i = 0; i < maxQueue; i++)
Expand Down Expand Up @@ -1209,7 +1209,7 @@ allTests(TestHelper* helper, bool collocated)
//
try
{
p->abort();
p->abortConnection();
test(false);
}
catch (const ConnectionLostException&)
Expand Down
4 changes: 2 additions & 2 deletions cpp/test/Ice/ami/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ interface TestIntf
out int eight, out int nine, out int ten, out int eleven);
int opBatchCount();
bool waitForBatch(int count);
void close();
void abort();
void closeConnection();
void abortConnection();
void sleep(int ms);
["amd"] void startDispatch();
void finishDispatch();
Expand Down
4 changes: 2 additions & 2 deletions cpp/test/Ice/ami/TestI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ TestIntfI::waitForBatch(int32_t count, const Ice::Current&)
}

void
TestIntfI::close(const Ice::Current& current)
TestIntfI::closeConnection(const Ice::Current& current)
{
current.con->close(nullptr, nullptr);
}

void
TestIntfI::abort(const Ice::Current& current)
TestIntfI::abortConnection(const Ice::Current& current)
{
current.con->abort();
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/test/Ice/ami/TestI.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class TestIntfI final : public Test::TestIntf
std::int32_t&,
const Ice::Current&) final;
bool waitForBatch(std::int32_t, const Ice::Current&) final;
void close(const Ice::Current&) final;
void abort(const Ice::Current&) final;
void closeConnection(const Ice::Current&) final;
void abortConnection(const Ice::Current&) final;
void sleep(std::int32_t, const Ice::Current&) final;
void startDispatchAsync(std::function<void()>, std::function<void(std::exception_ptr)>, const Ice::Current&) final;
void finishDispatch(const Ice::Current&) final;
Expand Down
4 changes: 2 additions & 2 deletions csharp/test/Ice/ami/AllTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ public static async Task allTestsAsync(global::Test.TestHelper helper, bool coll
}

bool sentSynchronously = true;
_ = p.closeAsync(
_ = p.closeConnectionAsync(
progress: new Progress<bool>(value => sentSynchronously = value));

if (!sentSynchronously)
Expand Down Expand Up @@ -797,7 +797,7 @@ public static async Task allTestsAsync(global::Test.TestHelper helper, bool coll
//
try
{
p.abort();
p.abortConnection();
test(false);
}
catch (Ice.ConnectionLostException)
Expand Down
4 changes: 2 additions & 2 deletions csharp/test/Ice/ami/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ interface TestIntf
int opBatchCount();
bool waitForBatch(int count);

void close();
void abort();
void closeConnection();
void abortConnection();
void sleep(int ms);
["amd"] void startDispatch();
void finishDispatch();
Expand Down
18 changes: 5 additions & 13 deletions csharp/test/Ice/ami/TestI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,15 @@ public override bool
}
}

public override void close(Ice.Current current)
public override void closeConnection(Ice.Current current)
{
closeConnection(current);
}

public override void abort(Ice.Current current)
{
abortConnection(current);
// We can't wait for the connection to close - it would self-deadlock. So we just initiate the closure.
_ = current.con.closeAsync();
}

public void abortConnection(Ice.Current current) => current.con.abort();

public void closeConnection(Ice.Current current)
public override void abortConnection(Ice.Current current)
{
// We can't wait for the connection to be closed - it would self-deadlock. So we just initiate the
// closure.
_ = current.con.closeAsync();
current.con.abort();
}

public override void
Expand Down
4 changes: 2 additions & 2 deletions java/test/src/main/java/test/Ice/ami/AllTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ public static void allTests(test.TestHelper helper, boolean collocated) {
for (int i = 0; i < maxQueue; ++i) {
results.add(Util.getInvocationFuture(p.opWithPayloadAsync(seq)));
}
if (!Util.getInvocationFuture(p.closeAsync()).isSent()) {
if (!Util.getInvocationFuture(p.closeConnectionAsync()).isSent()) {
for (int i = 0; i < maxQueue; i++) {
InvocationFuture<Void> r = Util.getInvocationFuture(p.opWithPayloadAsync(seq));
results.add(r);
Expand Down Expand Up @@ -982,7 +982,7 @@ public static void allTests(test.TestHelper helper, boolean collocated) {
// will not retry.
//
try {
p.abort();
p.abortConnection();
test(false);
} catch (com.zeroc.Ice.ConnectionLostException ex) {
// Expected.
Expand Down
4 changes: 2 additions & 2 deletions java/test/src/main/java/test/Ice/ami/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ interface TestIntf
void opBatch();
int opBatchCount();
bool waitForBatch(int count);
void close();
void abort();
void closeConnection();
void abortConnection();
void sleep(int ms);
["amd"] void startDispatch();
void finishDispatch();
Expand Down
4 changes: 2 additions & 2 deletions java/test/src/main/java/test/Ice/ami/TestI.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ public synchronized boolean waitForBatch(int count, com.zeroc.Ice.Current curren
}

@Override
public void close(com.zeroc.Ice.Current current) {
public void closeConnection(com.zeroc.Ice.Current current) {
// We can't wait for the connection to be closed - this would cause a self dead-lock.
// So instead we just initiate the closure by running `close` in a separate thread.
var closureThread = new Thread(() -> current.con.close());
closureThread.start();
}

@Override
public void abort(com.zeroc.Ice.Current current) {
public void abortConnection(com.zeroc.Ice.Current current) {
current.con.abort();
}

Expand Down
4 changes: 2 additions & 2 deletions js/test/Ice/ami/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ interface TestIntf
void opBatch();
int opBatchCount();
bool waitForBatch(int count);
void close();
void abort();
void closeConnection();
void abortConnection();
void sleep(int ms);
["amd"] void startDispatch();
void finishDispatch();
Expand Down
2 changes: 1 addition & 1 deletion matlab/test/Ice/ami/AllTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function allTests(helper)
% will not retry.
%
try
p.abort();
p.abortConnection();
assert(false);
catch ex
% Expected.
Expand Down
4 changes: 2 additions & 2 deletions matlab/test/Ice/ami/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ interface TestIntf
void opBatch();
int opBatchCount();
bool waitForBatch(int count);
void close();
void abort();
void closeConnection();
void abortConnection();
void sleep(int ms);
["amd"] void startDispatch();
void finishDispatch();
Expand Down
4 changes: 2 additions & 2 deletions python/test/Ice/ami/AllTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def allTests(helper, communicator, collocated):
# will not be closed until all pending dispatched requests have completed.
#
f = p.sleepAsync(100)
p.close() # Close is delayed until sleep completes.
p.closeConnection() # Close is delayed until sleep completes.
try:
f.result()
except Exception:
Expand Down Expand Up @@ -481,7 +481,7 @@ def allTests(helper, communicator, collocated):
# will not retry.
#
try:
p.abort()
p.abortConnection()
test(False)
except Ice.ConnectionLostException:
# Expected.
Expand Down
4 changes: 2 additions & 2 deletions python/test/Ice/ami/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ interface TestIntf
void opBatch();
int opBatchCount();
bool waitForBatch(int count);
void close();
void abort();
void closeConnection();
void abortConnection();
void sleep(int ms);
["amd"] void startDispatch();
void finishDispatch();
Expand Down
4 changes: 2 additions & 2 deletions python/test/Ice/ami/TestI.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def waitForBatch(self, count, current):
self._batchCount = 0
return result

def close(self, current):
def closeConnection(self, current):
current.con.close(False)

def abort(self, current):
def abortConnection(self, current):
current.con.abort()

def sleep(self, ms, current):
Expand Down
2 changes: 1 addition & 1 deletion swift/test/Ice/ami/AllTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func allTests(_ helper: TestHelper, collocated: Bool = false) async throws {
// will not retry.
//
do {
try await p.abort()
try await p.abortConnection()
try test(false)
} catch is Ice.ConnectionLostException {} // Expected.
}
Expand Down
4 changes: 2 additions & 2 deletions swift/test/Ice/ami/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ interface TestIntf
out int eight, out int nine, out int ten, out int eleven);
int opBatchCount();
bool waitForBatch(int count);
void close();
void abort();
void closeConnection();
void abortConnection();
void sleep(int ms);
["amd"] void startDispatch();
void finishDispatch();
Expand Down
4 changes: 2 additions & 2 deletions swift/test/Ice/ami/TestI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ class TestI: TestIntf {
return result
}

func close(current: Current) async throws {
func closeConnection(current: Current) async throws {
async let _ = current.con!.close()
}

func abort(current: Current) async throws {
func abortConnection(current: Current) async throws {
current.con!.abort()
}

Expand Down

0 comments on commit 42c7f8a

Please sign in to comment.