code: def send_if_client(fctn):
      
      @functools.wraps(fctn)
      def _send_if_client(self, *args, **kwargs):
          fctn_map = {'set_quantity': 'set_value'}
          b = self._bundle
          if b is not None and b.is_client:
              # TODO: self._filter???
              # TODO: args???
              method = fctn_map.get(fctn.__name__, fctn.__name__)
              d = self._filter if hasattr(self, '_filter') \
                  else {'twig': self.twig}
              d['bundleid'] = b._bundleid
              for k, v in kwargs.items():
                  d[k] = v
  
              logger.info('emitting to {}({}) to server'.format(method, d))
              b._socketio.emit(method, d)
  
              if fctn.__name__ in ['run_compute', 'run_fitting']:
                  # then we're expecting a quick response with an added jobparam
                  # let's add that now
                  self._bundle.client_update()
          else:
              return fctn(self, *args, **kwargs)
      return _send_if_client
docs: Intercept and send to the server if bundle is in client mode.