标签: queue

电子邮件在php中排队

在PHP中发送最小1000或更多的电子邮件的最正确方法是什么?任何可靠的电子邮件排队技术能够处理吗?

php email queue

5
推荐指数
1
解决办法
5444
查看次数

是否可以在C#中使用{a,b,c}实例化队列?

是否有可能在C#中做到这一点?

Queue<string> helperStrings = {"right", "left", "up", "down"};
Run Code Online (Sandbox Code Playgroud)

或者我必须首先制作阵列?

c# arrays queue icollection

5
推荐指数
2
解决办法
1747
查看次数

Amazon SQS漏斗数据库写入

因此,假设我正在建立netflix,我想通过userID和电影ID记录每个视图

因此它类似于viewID,userID,时间戳,

但是,为了扩展此功能,假定每秒获得1000次观看(只是为了疯狂)。将这些视图排队到SQS是否有意义,然后我们的队列读取器可以逐个取消排队并将其写入mysql数据库。这样,数据库不会因写请求而过载。

这看起来可行吗?

mysql queue scale amazon-sqs

5
推荐指数
1
解决办法
1286
查看次数

删除PriorityQueue的顶部?

假设我正在使用Java.util中的PriorityQueue类.我想从PriorityQueue pq中删除最大的数字,我们假设它位于队列的头部.

以下工作会吗?

// 1 
int head = pq.peek();
pq.dequeue(head);

// 2
int head = pq.dequeue(pq.peek());
Run Code Online (Sandbox Code Playgroud)

对于非原始的人来说,这也是一样的吗?

java queue priority-queue

5
推荐指数
2
解决办法
5580
查看次数

jQuery队列,它是如何工作的?

我很难弄清楚队列在jQuery中的工作方式,特别是fx队列.我想做的是:

一个接一个地动画多个不同的元素

先看看这个小提琴.单击该按钮时,两个元素都将被设置动画.现在我知道我可以做这样的小提琴,我将动画放在第一个动画的回调中,但这不是一个选项,因为我有一个情节,我有一个动画池,我想任意运行其中任何一个都按特定顺序排列.例如,我可能有动画A,B,C,D和E,它们都会动画不同的元素.有时我会想按B-> A-> C的顺序执行,另一次我可能想要A-> B-> C.

如何使用队列来实现此功能?

javascript queue jquery jquery-animate

5
推荐指数
1
解决办法
615
查看次数

System.Messaging.MessageQueueException-外部组件抛出异常

我通过Windows服务运行.exe,它从私有队列中读取消息.服务一切都很好而且稳定,但有时服务停止(它实际上没有停止,但它没有处理任何东西.服务状态仍然是"已启动",我需要手动重启它).

这个经常不会出现但是分析.exe文件的内存转储,我发现在异常下遇到了这么多线程.

异常对象:0000000001436120异常类型:System.Messaging.MessageQueueException消息:外部组件引发了异常.

System.Messaging.MessageQueueException- External component has thrown an exception
System.Messaging.MessageQueue.ReceiveCurrent(System.TimeSpan, Int32, System.Messaging.Interop.CursorHandle, System.Messaging.MessagePropertyFilter, System.Messaging.MessageQueueTransaction, System.Messaging.MessageQueueTransactionType) 
System.Messaging.MessageQueue.Peek(System.TimeSpan)
Run Code Online (Sandbox Code Playgroud)

知道服务遇到这个异常的原因吗?提前致谢

c# queue msmq message-queue msmq-transaction

5
推荐指数
0
解决办法
1555
查看次数

使用Process.Terminate()时如何解决队列损坏

我正在构建一个Python脚本/应用程序,它启动了多个所谓的Fetchers.他们反过来做某事并将数据返回队列.

我想确保Fetchers的运行时间不超过60秒(因为整个应用程序在一小时内运行多次).

阅读Python文档时,我注意到他们在使用Process.Terminate()时要小心,因为它可能会破坏Queue.

我目前的代码:

# Result Queue
resultQueue = Queue();

# Create Fetcher Instance
fetcher = fetcherClass()

# Create Fetcher Process List
fetcherProcesses = []

# Run Fetchers
for config in configList:
    # Create Process to encapsulate Fetcher
    log.debug("Creating Fetcher for Target: %s" % config['object_name'])
    fetcherProcess = Process(target=fetcher.Run, args=(config,resultQueue))

    log.debug("Starting Fetcher for Target: %s" % config['object_name'])
    fetcherProcess.start()
    fetcherProcesses.append((config, fetcherProcess))

# Wait for all Workers to complete
for config, fetcherProcess in fetcherProcesses:
    log.debug("Waiting for Thread to complete (%s)." % str(config['object_name']))
    fetcherProcess.join(DEFAULT_FETCHER_TIMEOUT) …
Run Code Online (Sandbox Code Playgroud)

python queue process multiprocessing

5
推荐指数
1
解决办法
639
查看次数

双端队列与队列速度

我正在处理LeetCode(在这里)上的问题。解决问题后,我想到了:

class MovingAverage {
    std::deque<int> numsToAverage;
    int maxSize;
    int currentTotal;
public:
    /** Initialize your data structure here. */
    MovingAverage(int size) {
        maxSize = size;
        currentTotal = 0;
    }

    double next(int val) 
    {
        currentTotal += val;
        numsToAverage.push_back(val);

        if (numsToAverage.size() > maxSize)
        {
            currentTotal -= numsToAverage[0];
            numsToAverage.pop_front();
        }

        return (double)currentTotal / (double)numsToAverage.size();
    }
};
Run Code Online (Sandbox Code Playgroud)

之后,我看到另一个解决方案与我的非常相似,但是使用了一个队列。出于好奇,我只将双双队列交换到队列中,然后从第18个百分位数(双队列)跳到第56个百分位数(队列)。这是队列代码:

class MovingAverage {
    std::queue<int> numsToAverage;
    int maxSize;
    int currentTotal;
public:
    /** Initialize your data structure here. */
    MovingAverage(int size) {
        maxSize …
Run Code Online (Sandbox Code Playgroud)

c++ queue performance deque

5
推荐指数
1
解决办法
1308
查看次数

如何使作业失败并使其跳过Laravel队列中的下一次尝试?

我正在写一个简单的队列。

namespace App\Jobs;

use App\SomeMessageSender;

class MessageJob extends Job
{
    protected $to;
    protected $text;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($to, $text)
    {
        $this->to = $to;
        $this->text = $text;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle(SomeMessageSender $sender)
    {
    if ($sender->paramsAreValid($this->to, $this->text) {
            $sender->sendMessage($this->to, $this->text);
        }
    else {
        // Fail without being attempted any further
            throw new Exception ('The message params are not valid');
        }
    } …
Run Code Online (Sandbox Code Playgroud)

queue laravel

5
推荐指数
1
解决办法
4403
查看次数

SWIFT-OperationQueue.main.addOperation和DispatchQueue.main.async有什么区别?

有时我必须在主线程上做一些事情,建议将代码放在OperationQueue.main.addOperation。

其他时候,建议在其中编写代码DispatchQueue.main.async。

两者之间有什么区别?

(有一个类似的问题标题,但是内容不匹配。)

queue asynchronous operation swift dispatch-queue

5
推荐指数
1
解决办法
334
查看次数