mirror of
https://github.com/OpenFOAM/ThirdParty-6.git
synced 2025-12-08 06:57:43 +00:00
42 lines
1.5 KiB
Python
42 lines
1.5 KiB
Python
r"""collaboration is a helper module useful for handling synchronisation
|
|
in multi-client configuration as well as providing other collaboration
|
|
related methods
|
|
|
|
A simple example:
|
|
from paraview import collaboration
|
|
|
|
collaboration.processServerEvents()
|
|
"""
|
|
#==============================================================================
|
|
#
|
|
# Program: ParaView
|
|
# Module: collaboration.py
|
|
#
|
|
# Copyright (c) Kitware, Inc.
|
|
# All rights reserved.
|
|
# See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
|
|
#
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even
|
|
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
# PURPOSE. See the above copyright notice for more information.
|
|
#
|
|
#==============================================================================
|
|
|
|
import paraview, re, new, sys, vtk
|
|
import simple
|
|
import servermanager
|
|
|
|
from paraview.vtk import vtkPVClientServerCoreCore
|
|
from paraview.vtk import vtkPVServerManagerCore
|
|
from paraview.vtk import vtkPVServerImplementationCore
|
|
from paraview.vtk import vtkCommonCore
|
|
|
|
def processServerEvents():
|
|
"""Update the local state based on the notifications received from the server
|
|
that have been generated by other clients."""
|
|
if servermanager.ActiveConnection:
|
|
session = servermanager.ActiveConnection.Session
|
|
if session.IsMultiClients() and session.IsNotBusy():
|
|
while vtkPVClientServerCoreCore.vtkProcessModule.GetProcessModule().GetNetworkAccessManager().ProcessEvents(100):
|
|
pass
|