diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/modules/IcePy/Communicator.cpp | 64 | ||||
-rw-r--r-- | python/modules/IcePy/Connection.cpp | 66 | ||||
-rw-r--r-- | python/python/Ice.py | 12 | ||||
-rw-r--r-- | python/test/Ice/ami/AllTests.py | 46 | ||||
-rw-r--r-- | python/test/Ice/operations/BatchOneways.py | 3 |
5 files changed, 132 insertions, 59 deletions
diff --git a/python/modules/IcePy/Communicator.cpp b/python/modules/IcePy/Communicator.cpp index 927c3cab5d2..37a99a78641 100644 --- a/python/modules/IcePy/Communicator.cpp +++ b/python/modules/IcePy/Communicator.cpp @@ -701,13 +701,24 @@ communicatorIdentityToString(CommunicatorObject* self, PyObject* args) extern "C" #endif static PyObject* -communicatorFlushBatchRequests(CommunicatorObject* self) +communicatorFlushBatchRequests(CommunicatorObject* self, PyObject* args) { + PyObject* compressBatchType = lookupType("Ice.CompressBatch"); + PyObject* compressBatch; + if(!PyArg_ParseTuple(args, STRCAST("O!"), compressBatchType, &compressBatch)) + { + return 0; + } + + PyObjectHandle v = PyObject_GetAttrString(compressBatch, STRCAST("_value")); + assert(v.get()); + Ice::CompressBatch cb = static_cast<Ice::CompressBatch>(PyLong_AsLong(v.get())); + assert(self->communicator); try { AllowThreads allowThreads; // Release Python's global interpreter lock to avoid a potential deadlock. - (*self->communicator)->flushBatchRequests(); + (*self->communicator)->flushBatchRequests(cb); } catch(const Ice::Exception& ex) { @@ -723,13 +734,24 @@ communicatorFlushBatchRequests(CommunicatorObject* self) extern "C" #endif static PyObject* -communicatorFlushBatchRequestsAsync(CommunicatorObject* self, PyObject* /*args*/, PyObject* /*kwds*/) +communicatorFlushBatchRequestsAsync(CommunicatorObject* self, PyObject* args, PyObject* /*kwds*/) { + PyObject* compressBatchType = lookupType("Ice.CompressBatch"); + PyObject* compressBatch; + if(!PyArg_ParseTuple(args, STRCAST("O!"), compressBatchType, &compressBatch)) + { + return 0; + } + + PyObjectHandle v = PyObject_GetAttrString(compressBatch, STRCAST("_value")); + assert(v.get()); + Ice::CompressBatch cb = static_cast<Ice::CompressBatch>(PyLong_AsLong(v.get())); + assert(self->communicator); const string op = "flushBatchRequests"; FlushAsyncCallbackPtr d = new FlushAsyncCallback(op); - Ice::Callback_Communicator_flushBatchRequestsPtr cb = + Ice::Callback_Communicator_flushBatchRequestsPtr callback = Ice::newCallback_Communicator_flushBatchRequests(d, &FlushAsyncCallback::exception, &FlushAsyncCallback::sent); Ice::AsyncResultPtr result; @@ -738,7 +760,7 @@ communicatorFlushBatchRequestsAsync(CommunicatorObject* self, PyObject* /*args*/ { AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations. - result = (*self->communicator)->begin_flushBatchRequests(cb); + result = (*self->communicator)->begin_flushBatchRequests(cb, callback); } catch(const Ice::Exception& ex) { @@ -771,17 +793,29 @@ communicatorBeginFlushBatchRequests(CommunicatorObject* self, PyObject* args, Py static char* argNames[] = { + const_cast<char*>("compress"), const_cast<char*>("_ex"), const_cast<char*>("_sent"), 0 }; + PyObject* compressBatch; PyObject* ex = Py_None; PyObject* sent = Py_None; - if(!PyArg_ParseTupleAndKeywords(args, kwds, STRCAST("|OO"), argNames, &ex, &sent)) + if(!PyArg_ParseTupleAndKeywords(args, kwds, STRCAST("O|OO"), argNames, &compressBatch, &ex, &sent)) + { + return 0; + } + + PyObject* compressBatchType = lookupType("Ice.CompressBatch"); + if(!PyObject_IsInstance(compressBatch, reinterpret_cast<PyObject*>(compressBatchType))) { return 0; } + PyObjectHandle v = PyObject_GetAttrString(compressBatch, STRCAST("_value")); + assert(v.get()); + Ice::CompressBatch cb = static_cast<Ice::CompressBatch>(PyLong_AsLong(v.get())); + if(ex == Py_None) { ex = 0; @@ -798,11 +832,11 @@ communicatorBeginFlushBatchRequests(CommunicatorObject* self, PyObject* args, Py return 0; } - Ice::Callback_Communicator_flushBatchRequestsPtr cb; + Ice::Callback_Communicator_flushBatchRequestsPtr callback; if(ex || sent) { FlushCallbackPtr d = new FlushCallback(ex, sent, "flushBatchRequests"); - cb = Ice::newCallback_Communicator_flushBatchRequests(d, &FlushCallback::exception, &FlushCallback::sent); + callback = Ice::newCallback_Communicator_flushBatchRequests(d, &FlushCallback::exception, &FlushCallback::sent); } Ice::AsyncResultPtr result; @@ -810,13 +844,13 @@ communicatorBeginFlushBatchRequests(CommunicatorObject* self, PyObject* args, Py { AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations. - if(cb) + if(callback) { - result = (*self->communicator)->begin_flushBatchRequests(cb); + result = (*self->communicator)->begin_flushBatchRequests(cb, callback); } else { - result = (*self->communicator)->begin_flushBatchRequests(); + result = (*self->communicator)->begin_flushBatchRequests(cb); } } catch(const Ice::Exception& ex) @@ -1648,13 +1682,13 @@ static PyMethodDef CommunicatorMethods[] = PyDoc_STR(STRCAST("getDefaultLocator() -> proxy")) }, { STRCAST("setDefaultLocator"), reinterpret_cast<PyCFunction>(communicatorSetDefaultLocator), METH_VARARGS, PyDoc_STR(STRCAST("setDefaultLocator(proxy) -> None")) }, - { STRCAST("flushBatchRequests"), reinterpret_cast<PyCFunction>(communicatorFlushBatchRequests), METH_NOARGS, - PyDoc_STR(STRCAST("flushBatchRequests() -> None")) }, + { STRCAST("flushBatchRequests"), reinterpret_cast<PyCFunction>(communicatorFlushBatchRequests), METH_VARARGS, + PyDoc_STR(STRCAST("flushBatchRequests(compress) -> None")) }, { STRCAST("flushBatchRequestsAsync"), reinterpret_cast<PyCFunction>(communicatorFlushBatchRequestsAsync), - METH_NOARGS, PyDoc_STR(STRCAST("flushBatchRequestsAsync() -> Ice.Future")) }, + METH_VARARGS, PyDoc_STR(STRCAST("flushBatchRequestsAsync(compress) -> Ice.Future")) }, { STRCAST("begin_flushBatchRequests"), reinterpret_cast<PyCFunction>(communicatorBeginFlushBatchRequests), METH_VARARGS | METH_KEYWORDS, - PyDoc_STR(STRCAST("begin_flushBatchRequests([_ex][, _sent]) -> Ice.AsyncResult")) }, + PyDoc_STR(STRCAST("begin_flushBatchRequests(compress[, _ex][, _sent]) -> Ice.AsyncResult")) }, { STRCAST("end_flushBatchRequests"), reinterpret_cast<PyCFunction>(communicatorEndFlushBatchRequests), METH_VARARGS, PyDoc_STR(STRCAST("end_flushBatchRequests(Ice.AsyncResult) -> None")) }, { STRCAST("createAdmin"), reinterpret_cast<PyCFunction>(communicatorCreateAdmin), METH_VARARGS, diff --git a/python/modules/IcePy/Connection.cpp b/python/modules/IcePy/Connection.cpp index 8e9e9286d02..056dc42e4ab 100644 --- a/python/modules/IcePy/Connection.cpp +++ b/python/modules/IcePy/Connection.cpp @@ -418,13 +418,24 @@ connectionGetAdapter(ConnectionObject* self) extern "C" #endif static PyObject* -connectionFlushBatchRequests(ConnectionObject* self) +connectionFlushBatchRequests(ConnectionObject* self, PyObject* args) { + PyObject* compressBatchType = lookupType("Ice.CompressBatch"); + PyObject* compressBatch; + if(!PyArg_ParseTuple(args, STRCAST("O!"), compressBatchType, &compressBatch)) + { + return 0; + } + + PyObjectHandle v = PyObject_GetAttrString(compressBatch, STRCAST("_value")); + assert(v.get()); + Ice::CompressBatch cb = static_cast<Ice::CompressBatch>(PyLong_AsLong(v.get())); + assert(self->connection); try { AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations. - (*self->connection)->flushBatchRequests(); + (*self->connection)->flushBatchRequests(cb); } catch(const Ice::Exception& ex) { @@ -440,13 +451,24 @@ connectionFlushBatchRequests(ConnectionObject* self) extern "C" #endif static PyObject* -connectionFlushBatchRequestsAsync(ConnectionObject* self, PyObject* /*args*/, PyObject* /*kwds*/) +connectionFlushBatchRequestsAsync(ConnectionObject* self, PyObject* args, PyObject* /*kwds*/) { + PyObject* compressBatchType = lookupType("Ice.CompressBatch"); + PyObject* compressBatch; + if(!PyArg_ParseTuple(args, STRCAST("O!"), compressBatchType, &compressBatch)) + { + return 0; + } + + PyObjectHandle v = PyObject_GetAttrString(compressBatch, STRCAST("_value")); + assert(v.get()); + Ice::CompressBatch cb = static_cast<Ice::CompressBatch>(PyLong_AsLong(v.get())); + assert(self->connection); const string op = "flushBatchRequests"; FlushAsyncCallbackPtr d = new FlushAsyncCallback(op); - Ice::Callback_Connection_flushBatchRequestsPtr cb = + Ice::Callback_Connection_flushBatchRequestsPtr callback = Ice::newCallback_Connection_flushBatchRequests(d, &FlushAsyncCallback::exception, &FlushAsyncCallback::sent); Ice::AsyncResultPtr result; @@ -455,7 +477,7 @@ connectionFlushBatchRequestsAsync(ConnectionObject* self, PyObject* /*args*/, Py { AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations. - result = (*self->connection)->begin_flushBatchRequests(cb); + result = (*self->connection)->begin_flushBatchRequests(cb, callback); } catch(const Ice::Exception& ex) { @@ -490,17 +512,29 @@ connectionBeginFlushBatchRequests(ConnectionObject* self, PyObject* args, PyObje static char* argNames[] = { + const_cast<char*>("compress"), const_cast<char*>("_ex"), const_cast<char*>("_sent"), 0 }; + PyObject* compressBatch; PyObject* ex = Py_None; PyObject* sent = Py_None; - if(!PyArg_ParseTupleAndKeywords(args, kwds, STRCAST("|OO"), argNames, &ex, &sent)) + if(!PyArg_ParseTupleAndKeywords(args, kwds, STRCAST("O|OO"), argNames, &compressBatch, &ex, &sent)) + { + return 0; + } + + PyObject* compressBatchType = lookupType("Ice.CompressBatch"); + if(!PyObject_IsInstance(compressBatch, reinterpret_cast<PyObject*>(compressBatchType))) { return 0; } + PyObjectHandle v = PyObject_GetAttrString(compressBatch, STRCAST("_value")); + assert(v.get()); + Ice::CompressBatch cb = static_cast<Ice::CompressBatch>(PyLong_AsLong(v.get())); + if(ex == Py_None) { ex = 0; @@ -517,11 +551,11 @@ connectionBeginFlushBatchRequests(ConnectionObject* self, PyObject* args, PyObje return 0; } - Ice::Callback_Connection_flushBatchRequestsPtr cb; + Ice::Callback_Connection_flushBatchRequestsPtr callback; if(ex || sent) { FlushCallbackPtr d = new FlushCallback(ex, sent, "flushBatchRequests"); - cb = Ice::newCallback_Connection_flushBatchRequests(d, &FlushCallback::exception, &FlushCallback::sent); + callback = Ice::newCallback_Connection_flushBatchRequests(d, &FlushCallback::exception, &FlushCallback::sent); } Ice::AsyncResultPtr result; @@ -529,13 +563,13 @@ connectionBeginFlushBatchRequests(ConnectionObject* self, PyObject* args, PyObje { AllowThreads allowThreads; // Release Python's global interpreter lock during remote invocations. - if(cb) + if(callback) { - result = (*self->connection)->begin_flushBatchRequests(cb); + result = (*self->connection)->begin_flushBatchRequests(cb, callback); } else { - result = (*self->connection)->begin_flushBatchRequests(); + result = (*self->connection)->begin_flushBatchRequests(cb); } } catch(const Ice::Exception& ex) @@ -1059,19 +1093,19 @@ connectionThrowException(ConnectionObject* self) static PyMethodDef ConnectionMethods[] = { { STRCAST("close"), reinterpret_cast<PyCFunction>(connectionClose), METH_VARARGS, - PyDoc_STR(STRCAST("close(bool) -> None")) }, + PyDoc_STR(STRCAST("close(Ice.ConnectionClose) -> None")) }, { STRCAST("createProxy"), reinterpret_cast<PyCFunction>(connectionCreateProxy), METH_VARARGS, PyDoc_STR(STRCAST("createProxy(Ice.Identity) -> Ice.ObjectPrx")) }, { STRCAST("setAdapter"), reinterpret_cast<PyCFunction>(connectionSetAdapter), METH_VARARGS, PyDoc_STR(STRCAST("setAdapter(Ice.ObjectAdapter) -> None")) }, { STRCAST("getAdapter"), reinterpret_cast<PyCFunction>(connectionGetAdapter), METH_NOARGS, PyDoc_STR(STRCAST("getAdapter() -> Ice.ObjectAdapter")) }, - { STRCAST("flushBatchRequests"), reinterpret_cast<PyCFunction>(connectionFlushBatchRequests), METH_NOARGS, - PyDoc_STR(STRCAST("flushBatchRequests() -> None")) }, + { STRCAST("flushBatchRequests"), reinterpret_cast<PyCFunction>(connectionFlushBatchRequests), METH_VARARGS, + PyDoc_STR(STRCAST("flushBatchRequests(Ice.CompressBatch) -> None")) }, { STRCAST("flushBatchRequestsAsync"), reinterpret_cast<PyCFunction>(connectionFlushBatchRequestsAsync), - METH_NOARGS, PyDoc_STR(STRCAST("flushBatchRequestsAsync() -> Ice.Future")) }, + METH_VARARGS, PyDoc_STR(STRCAST("flushBatchRequestsAsync(Ice.CompressBatch) -> Ice.Future")) }, { STRCAST("begin_flushBatchRequests"), reinterpret_cast<PyCFunction>(connectionBeginFlushBatchRequests), - METH_VARARGS | METH_KEYWORDS, PyDoc_STR(STRCAST("begin_flushBatchRequests([_ex][, _sent]) -> Ice.AsyncResult")) }, + METH_VARARGS | METH_KEYWORDS, PyDoc_STR(STRCAST("begin_flushBatchRequests(Ice.CompressBatch, [_ex][, _sent]) -> Ice.AsyncResult")) }, { STRCAST("end_flushBatchRequests"), reinterpret_cast<PyCFunction>(connectionEndFlushBatchRequests), METH_VARARGS, PyDoc_STR(STRCAST("end_flushBatchRequests(Ice.AsyncResult) -> None")) }, { STRCAST("setCloseCallback"), reinterpret_cast<PyCFunction>(connectionSetCloseCallback), METH_VARARGS, diff --git a/python/python/Ice.py b/python/python/Ice.py index 80b48c639fc..9ce81306fb7 100644 --- a/python/python/Ice.py +++ b/python/python/Ice.py @@ -938,14 +938,14 @@ class CommunicatorI(Communicator): def getPluginManager(self): raise RuntimeError("operation `getPluginManager' not implemented") - def flushBatchRequests(self): - self._impl.flushBatchRequests() + def flushBatchRequests(self, compress): + self._impl.flushBatchRequests(compress) - def flushBatchRequestsAsync(self): - return self._impl.flushBatchRequestsAsync() + def flushBatchRequestsAsync(self, compress): + return self._impl.flushBatchRequestsAsync(compress) - def begin_flushBatchRequests(self, _ex=None, _sent=None): - return self._impl.begin_flushBatchRequests(_ex, _sent) + def begin_flushBatchRequests(self, compress, _ex=None, _sent=None): + return self._impl.begin_flushBatchRequests(compress, _ex, _sent) def end_flushBatchRequests(self, r): return self._impl.end_flushBatchRequests(r) diff --git a/python/test/Ice/ami/AllTests.py b/python/test/Ice/ami/AllTests.py index d29311fd9d6..78c71233218 100644 --- a/python/test/Ice/ami/AllTests.py +++ b/python/test/Ice/ami/AllTests.py @@ -805,7 +805,7 @@ def allTests(communicator, collocated): b1.opBatch() b1.opBatch() cb = FlushCallback() - r = b1.ice_getConnection().begin_flushBatchRequests(cb.exception, cb.sent) + r = b1.ice_getConnection().begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy, cb.exception, cb.sent) cb.check() test(r.isSent()) test(r.isCompleted()) @@ -819,7 +819,8 @@ def allTests(communicator, collocated): b1.opBatch() b1.opBatch() cb = FlushCallback(cookie) - r = b1.ice_getConnection().begin_flushBatchRequests(lambda ex: cb.exceptionWC(ex, cookie), + r = b1.ice_getConnection().begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy, + lambda ex: cb.exceptionWC(ex, cookie), lambda ss: cb.sentWC(ss, cookie)) cb.check() test(p.waitForBatch(2)) @@ -832,7 +833,7 @@ def allTests(communicator, collocated): b1.opBatch() b1.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) cb = FlushExCallback() - r = b1.ice_getConnection().begin_flushBatchRequests(cb.exception, cb.sent) + r = b1.ice_getConnection().begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy, cb.exception, cb.sent) cb.check() test(not r.isSent()) test(r.isCompleted()) @@ -846,7 +847,8 @@ def allTests(communicator, collocated): b1.opBatch() b1.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) cb = FlushExCallback(cookie) - r = b1.ice_getConnection().begin_flushBatchRequests(lambda ex: cb.exceptionWC(ex, cookie), + r = b1.ice_getConnection().begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy, + lambda ex: cb.exceptionWC(ex, cookie), lambda ss: cb.sentWC(ss, cookie)) cb.check() test(p.opBatchCount() == 0) @@ -864,7 +866,7 @@ def allTests(communicator, collocated): b1.opBatch() b1.opBatch() cb = FlushCallback() - r = communicator.begin_flushBatchRequests(cb.exception, cb.sent) + r = communicator.begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy, cb.exception, cb.sent) cb.check() test(r.isSent()) test(r.isCompleted()) @@ -878,7 +880,7 @@ def allTests(communicator, collocated): b1.opBatch() b1.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) cb = FlushCallback() - r = communicator.begin_flushBatchRequests(cb.exception, cb.sent) + r = communicator.begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy, cb.exception, cb.sent) cb.check() test(r.isSent()) # Exceptions are ignored! test(r.isCompleted()) @@ -897,7 +899,7 @@ def allTests(communicator, collocated): b2.opBatch() b2.opBatch() cb = FlushCallback() - r = communicator.begin_flushBatchRequests(cb.exception, cb.sent) + r = communicator.begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy, cb.exception, cb.sent) cb.check() test(r.isSent()) test(r.isCompleted()) @@ -918,7 +920,7 @@ def allTests(communicator, collocated): b2.opBatch() b1.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) cb = FlushCallback() - r = communicator.begin_flushBatchRequests(cb.exception, cb.sent) + r = communicator.begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy, cb.exception, cb.sent) cb.check() test(r.isSent()) # Exceptions are ignored! test(r.isCompleted()) @@ -939,7 +941,7 @@ def allTests(communicator, collocated): b1.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) b2.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) cb = FlushCallback() - r = communicator.begin_flushBatchRequests(cb.exception, cb.sent) + r = communicator.begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy, cb.exception, cb.sent) cb.check() test(r.isSent()) # Exceptions are ignored! test(r.isCompleted()) @@ -1041,7 +1043,7 @@ def allTests(communicator, collocated): con = p.ice_getConnection() p2 = p.ice_batchOneway() p2.ice_ping() - r = con.begin_flushBatchRequests() + r = con.begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy) test(r.getConnection() == con) test(r.getCommunicator() == communicator) test(r.getProxy() == None) # Expected @@ -1052,7 +1054,7 @@ def allTests(communicator, collocated): # p2 = p.ice_batchOneway() p2.ice_ping() - r = communicator.begin_flushBatchRequests() + r = communicator.begin_flushBatchRequests(Ice.CompressBatch.BasedOnProxy) test(r.getConnection() == None) # Expected test(r.getCommunicator() == communicator) test(r.getProxy() == None) # Expected @@ -1191,7 +1193,7 @@ def allTests(communicator, collocated): # # This test requires two threads in the server's thread pool: one will block in sleep() and the other # will process the CloseConnection message. - # + # p.ice_ping() con = p.ice_getConnection() r = p.begin_sleep(1000) @@ -1232,7 +1234,7 @@ def allTests(communicator, collocated): # # Local case: start a lengthy operation and then close the connection forcefully on the client side. # There will be no retry and we expect the invocation to fail with ConnectionManuallyClosedException. - # + # p.ice_ping() con = p.ice_getConnection() r = p.begin_sleep(100) @@ -1520,7 +1522,7 @@ def allTestsFuture(communicator, collocated): b1.opBatch() b1.opBatch() cb = FutureFlushCallback() - f = b1.ice_getConnection().flushBatchRequestsAsync() + f = b1.ice_getConnection().flushBatchRequestsAsync(Ice.CompressBatch.BasedOnProxy) f.add_sent_callback(cb.sent) cb.check() f.result() # Wait until finished. @@ -1533,7 +1535,7 @@ def allTestsFuture(communicator, collocated): b1.opBatch() b1.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) cb = FutureFlushExCallback() - f = b1.ice_getConnection().flushBatchRequestsAsync() + f = b1.ice_getConnection().flushBatchRequestsAsync(Ice.CompressBatch.BasedOnProxy) f.add_done_callback(cb.exception) f.add_sent_callback(cb.sent) cb.check() @@ -1554,7 +1556,7 @@ def allTestsFuture(communicator, collocated): b1.opBatch() b1.opBatch() cb = FutureFlushCallback() - f = communicator.flushBatchRequestsAsync() + f = communicator.flushBatchRequestsAsync(Ice.CompressBatch.BasedOnProxy) f.add_sent_callback(cb.sent) cb.check() f.result() # Wait until finished. @@ -1570,7 +1572,7 @@ def allTestsFuture(communicator, collocated): b1.opBatch() b1.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) cb = FutureFlushCallback() - f = communicator.flushBatchRequestsAsync() + f = communicator.flushBatchRequestsAsync(Ice.CompressBatch.BasedOnProxy) f.add_sent_callback(cb.sent) cb.check() f.result() # Wait until finished. @@ -1591,7 +1593,7 @@ def allTestsFuture(communicator, collocated): b2.opBatch() b2.opBatch() cb = FutureFlushCallback() - f = communicator.flushBatchRequestsAsync() + f = communicator.flushBatchRequestsAsync(Ice.CompressBatch.BasedOnProxy) f.add_sent_callback(cb.sent) cb.check() f.result() # Wait until finished. @@ -1614,7 +1616,7 @@ def allTestsFuture(communicator, collocated): b2.opBatch() b1.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) cb = FutureFlushCallback() - f = communicator.flushBatchRequestsAsync() + f = communicator.flushBatchRequestsAsync(Ice.CompressBatch.BasedOnProxy) f.add_sent_callback(cb.sent) cb.check() f.result() # Wait until finished. @@ -1637,7 +1639,7 @@ def allTestsFuture(communicator, collocated): b1.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) b2.ice_getConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait) cb = FutureFlushCallback() - f = communicator.flushBatchRequestsAsync() + f = communicator.flushBatchRequestsAsync(Ice.CompressBatch.BasedOnProxy) f.add_sent_callback(cb.sent) cb.check() f.result() # Wait until finished. @@ -1740,7 +1742,7 @@ def allTestsFuture(communicator, collocated): con = p.ice_getConnection() p2 = p.ice_batchOneway() p2.ice_ping() - f = con.flushBatchRequestsAsync() + f = con.flushBatchRequestsAsync(Ice.CompressBatch.BasedOnProxy) test(f.connection() == con) test(f.communicator() == communicator) test(f.proxy() == None) # Expected @@ -1751,7 +1753,7 @@ def allTestsFuture(communicator, collocated): # p2 = p.ice_batchOneway() p2.ice_ping() - f = communicator.flushBatchRequestsAsync() + f = communicator.flushBatchRequestsAsync(Ice.CompressBatch.BasedOnProxy) test(f.connection() == None) # Expected test(f.communicator() == communicator) test(f.proxy() == None) # Expected diff --git a/python/test/Ice/operations/BatchOneways.py b/python/test/Ice/operations/BatchOneways.py index ea0fc26c29c..3b17cd89954 100644 --- a/python/test/Ice/operations/BatchOneways.py +++ b/python/test/Ice/operations/BatchOneways.py @@ -64,6 +64,9 @@ def batchOneways(p): batch = Test.MyClassPrx.uncheckedCast(p.ice_batchOneway()) batch.ice_flushBatchRequests() # Empty flush + if batch.ice_getConnection(): + batch.ice_getConnection().flushBatchRequests(Ice.CompressBatch.BasedOnProxy) + batch.ice_getCommunicator().flushBatchRequests(Ice.CompressBatch.BasedOnProxy) p.opByteSOnewayCallCount() # Reset the call count |