@control_command(args=[(u'n', int)], signature=u'[N=1]')
def pool_shrink(state, n=1, **kwargs):
 if state.consumer.controller.autoscaler:
  state.consumer.controller.autoscaler.force_scale_down(n)
 else:
  state.consumer.pool.shrink(n)
  state.consumer._update_prefetch_count((- n))
 return ok(u'pool will shrink')

@ control_command ( args = [ ( u'n' , int ) ] , signature = u'[N=1]' ) def pool_shrink ( state , n = 1 , ** kwargs ) : if state . consumer . controller . autoscaler : state . consumer . controller . autoscaler . force_scale_down ( n ) else : state . consumer . pool . shrink ( n ) state . consumer . _update_prefetch_count ( ( - n ) ) return ok ( u'pool will shrink' )
shrink pool by n processes/threads .