Create RackSpace Queue.
553271
def create(self, qname):
        '''
        
        '''
        try:
            if self.exists(qname):
                log.error('Queues "%s" already exists. Nothing done.', qname)
                return True

            self.conn.create(qname)

            return True
        except pyrax.exceptions as err_msg:
            log.error('RackSpace API got some problems during creation: %s',
                      err_msg)
        return False
561966
def setup_server(config_path):
    """"""
    # configure the SharQ server
    server = SharQServer(config_path)
    # start the requeue loop
    gevent.spawn(server.requeue)

    return server
791704
def create(
    name,
    attributes=None,
    region=None,
    key=None,
    keyid=None,
    profile=None,
):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    if attributes is None:
        attributes = {}
    attributes = _preprocess_attributes(attributes)

    try:
        conn.create_queue(QueueName=name, Attributes=attributes)
    except botocore.exceptions.ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
    return {'result': True}
53811
function queue(task, done) {
    var storage = this,
        key = this.keygen(task);

    // store task as JSON serialized string
    task = JSON.stringify(task);

    // first add the key to the queue
    this.redis().rpush(this.queueKey(), key, function(err) {
        if (err) done(err);

        // now store task data
        else storage.redis().set(key, task, function(err) {
            if (err) done(err);
            else done(null, key);
        });
    });
}
296803
public static <E> Queue<E> createStack(int initSize) {
		return Collections.asLifoQueue(new ArrayDeque<E>(initSize));
	}
764724
def queue(name, arguments = {})
      with_bunny_precondition_handler('queue') do
        namespace = @config[:namespace].to_s.downcase.gsub(/[^-_:\.\w]/, "")
        name = name.prepend(namespace + ":") if namespace.present?
        channel.queue(name, durable: true, arguments: arguments)
      end
    end
575994
def queue(self):
        """"""
        with self.connection_pool.acquire(block=True) as conn:
            return Q(
                self.routing_key,
                exchange=self.exchange,
                routing_key=self.routing_key
            )(conn)
68280
async def create_lease_store_if_not_exists_async(self):
        
        try:
            await self.host.loop.run_in_executor(
                self.executor,
                functools.partial(
                    self.storage_client.create_container,
                    self.lease_container_name))

        except Exception as err:  # pylint: disable=broad-except
            _logger.error("%r", err)
            raise err

        return True
1016554
def enqueue(self, item_type, item):
        """"""

        with self.enlock:
            self.queue[item_type].append(item)
1057380
def enqueue_jobs(self, jobs: Iterable[Job]):
        """"""
        jobs_to_queue = list()
        for job in jobs:
            if job.should_start:
                job.status = JobStatus.QUEUED
            else:
                job.status = JobStatus.WAITING
            jobs_to_queue.append(job.serialize())

        if jobs_to_queue:
            self._run_script(
                self._enqueue_job,
                self._to_namespaced(NOTIFICATIONS_KEY),
                self._to_namespaced(RUNNING_JOBS_KEY.format(self._id)),
                self.namespace,
                self._to_namespaced(FUTURE_JOBS_KEY),
                *jobs_to_queue
            )
952802
function Queue(name, opts) {

	// allow call as function
	if (!(this instanceof Queue))
		return new Queue(name, opts);

	if (!name) {
		throw new Error('queue name is required');
	}

	opts = opts || {};

	// basic
	this.name = name;
	this.port = opts.port || 6379;
	this.host = opts.host || '127.0.0.1';

	// queue config
	this.config = {
		blockTimeout: opts.blockTimeout || 60
		, maxRetry: opts.maxRetry || 3
	};

	// redis options
	this.opts = opts;

	// main redis client
	this.client = Redis.createClient(this.port, this.host, this.opts);

	// client for blocking command only
	this.bclient = Redis.createClient(this.port, this.host, this.opts);

	// queue name
	this.prefix = 'dq:' + this.name;
	this.workQueue = this.prefix + ':work';
	this.runQueue = this.prefix + ':run';
	this.failQueue = this.prefix + ':fail';

	// status code
	this.status_timeout = 1;

	// queue status
	this.shutdown = false;
	this.running = false;

}
366487
def create(self):
        """"""
        self.logger.log(logging.DEBUG, 'os.mkdir %s', self.name)
        os.mkdir(self.name)
222164
def _ensure_queue(self):
        """"""
        if self._queue_path not in self._client.kv:
            self._client.kv[self._queue_path] = None
1367574
def create_network(self, network):
        """"""
        n_res = MechResource(network['id'], a_const.NETWORK_RESOURCE,
                             a_const.CREATE)
        self.provision_queue.put(n_res)
113469
async def create(cls, name: str,
                     default_for_unspecified: int,
                     total_resource_slots: int,
                     max_concurrent_sessions: int,
                     max_containers_per_session: int,
                     max_vfolder_count: int,
                     max_vfolder_size: int,
                     idle_timeout: int,
                     allowed_vfolder_hosts: Sequence[str],
                     fields: Iterable[str] = None) -> dict:
        
        if fields is None:
            fields = ('name',)
        q = 'mutation($name: String!, $input: CreateKeyPairResourcePolicyInput!) {' \
            + \
            '  create_keypair_resource_policy(name: $name, props: $input) {' \
            '    ok msg resource_policy { $fields }' \
            '  }' \
            '}'
        q = q.replace('$fields', ' '.join(fields))
        variables = {
            'name': name,
            'input': {
                'default_for_unspecified': default_for_unspecified,
                'total_resource_slots': total_resource_slots,
                'max_concurrent_sessions': max_concurrent_sessions,
                'max_containers_per_session': max_containers_per_session,
                'max_vfolder_count': max_vfolder_count,
                'max_vfolder_size': max_vfolder_size,
                'idle_timeout': idle_timeout,
                'allowed_vfolder_hosts': allowed_vfolder_hosts,
            },
        }
        rqst = Request(cls.session, 'POST', '/admin/graphql')
        rqst.set_json({
            'query': q,
            'variables': variables,
        })
        async with rqst.fetch() as resp:
            data = await resp.json()
            return data['create_keypair_resource_policy']
1087616
def create(self):
        """"""
        self.buffer = []
        self.buf_count = 0
        if not self.directory.exists: self.directory.create()
        self.open('w')
        return self
416458
def create_queue(name, attributes = {})
      response = action("CreateQueue", {"QueueName" => Queue.sanitize_name("#{queue_prefix}#{name}")}.merge(attributes))

      if response.success?
        Queue.new(self, response.doc.xpath("//QueueUrl").text)
      else
        raise "Could not create queue #{name}"
      end

    rescue AwsActionError => error
      if error.code == "AWS.SimpleQueueService.QueueDeletedRecently"
        raise QueueDeletedRecentlyError, error.message
      else
        raise error
      end
    end