首页 \ 问答 \ 在Actionscript3中按名称播放库中的声音(Play sound from library by its name in Actionscript3)

在Actionscript3中按名称播放库中的声音(Play sound from library by its name in Actionscript3)

是否可以通过其名称从库中播放声音,而不是在actionscript3中播放类链接? 这意味着如果我在库中有一个名为“mysound.mp3”的声音并且没有链接名称,我可以在我的代码中以任何方式动态播放吗? 我希望我的问题很清楚。


Is it possible to play a sound from the library by its name and not Class Linkage in actionscript3?? Meaning if I have a sound named "mysound.mp3" in library and does not have a linkage name, can I play it dynamically in my code by any means?? I hope my question is clear.


原文:https://stackoverflow.com/questions/27740552
更新时间:2023-06-11 21:06

最满意答案

您只能拥有1个Web进程类型。 您可以水平缩放您的web进程以在多个dynos上运行(“水平可伸缩性”),但是您至少需要升级至标准1x dyno类型才能这样做(即,如果您正在使用,则只能运行1个web dyno实例免费或爱好动态类型)。

但是,除了Web进程之外,还可以实例化多个其他进程类型(例如“worker”进程)。 这些将无法侦听来自客户端的HTTP / S请求,但可用于从Web进程中卸载长时间运行的作业。

因此,如果您将每个4-6微服务映射到Procfile中的不同Process Type,并且如果您的微服务不是他们自己的Web服务器,那么您可能可以使用爱好dynos。


You can only have 1 web process type. You can horizontally scale your web process to run on multiple dynos ("horizontal scalability"), however you will need to upgrade to at least standard-1x dyno types to do that (i.e. you can only run 1 web dyno instance if you are using free or hobby dyno types).

However, in addition to your web process, you can instantiate multiple additional process types (e.g. "worker" processes). These will NOT be able to listen on HTTP/S requests from your clients, but can be used for offloading long-running jobs from your web process.

So, if you map each of your 4-6 microservices to a different Process Type in your Procfile, and if your microservices are not themselves web servers, you might be able to make do with hobby dynos.

相关问答

更多
  • 如果您运行: $ heroku run bash $ unicorn -c config/unicorn.rb & $ ps euf 你应该得到类似的东西: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND u16236 2 0.0 0.0 19444 2024 ? S 20:55 0:00 bash GOOGLE_ANALYTICS_ID=XXX HEROKU_POSTGRESQL_COPPER_URL= ...
  • 您只能拥有1个Web进程类型。 您可以水平缩放您的web进程以在多个dynos上运行(“水平可伸缩性”),但是您至少需要升级至标准1x dyno类型才能这样做(即,如果您正在使用,则只能运行1个web dyno实例免费或爱好动态类型)。 但是,除了Web进程之外,还可以实例化多个其他进程类型(例如“worker”进程)。 这些将无法侦听来自客户端的HTTP / S请求,但可用于从Web进程中卸载长时间运行的作业。 因此,如果您将每个4-6微服务映射到Procfile中的不同Process Type,并且如果 ...
  • 一个dyno是一个容器。 你可以把它想象成一个服务器。 Heroku允许您监视每个dyno的单个进程,如果该进程崩溃,则在另一个实例上重新启动dyno。 但是如果你愿意,你可以启动多个。 如果它们崩溃,它们将不会自动重启。 一种方法是创建一个start-process文件,并给它+x chmod标志,以便它可以执行。 然后,在该文件中,您将拥有以下内容: #!/bin/bash -e start-first-process & start-second-process 这将启动第一个进程(不要忘记&在结束 ...
  • 编辑:添加了简化的示例代码,更好地解释了正在进行的请求/终止,并添加了CrazyPython的要点。 从表面上看,你有4个问题需要解决。 我将轮流接受它们,然后提供一些示例代码,以帮助澄清: 处理SIGTERM 这很简单。 您只需要设置一个信号处理程序,注意您需要关闭。 PMOTW有很多关于如何捕获信号的例子。 您可以使用此代码的变体来捕获SIGTERM并设置一个表示您正在关闭的全局标志。 拒绝新请求 Django中间件提供了一种巧妙的方法来将任何HTTP请求挂钩到您的应用程序。 您可以创建一个简单的pro ...
  • 根据@ radiospiel的相关帖子 ,您可以使用foreman启动多个进程。 1)将工头添加到您的Gemfile中 2)创建两个文件: Procfile: web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb worker: bundle exec foreman start -f Procfile.workers Procfile.workers: dj_worker: bundle exec rake jobs:work dj_worke ...
  • 你的Procfile中不应该有“heroku ps:scale web = 0”这一行。 这样做会告诉heroku创建一个名为“heroku”的进程类型,它试图在为其实例化的任何dyno实例上运行以下命令:“ps:scale web = 0”。 这可能会产生错误,无论如何,这不是你想要的。 相反,您应该运行“heroku ps:scale web = 0”作为Heroku toolbelt CLI命令(或者从GUI的“资源”选项卡执行等效操作,如您所做的那样)。 You should not have th ...
  • 您正在看到一个Sidekiq进程,其中25个线程同时运行作业。 每个线程都将执行一个作业,因此您最多可以同时运行25个作业。 没有swarm,每个dyno只能运行一个进程。 您可以使用swarm在dyno中运行多个进程,但有多少进程取决于应用程序的内存要求以及dyno中的内核数量。 这将为您提供100个工作线程:4 * 25。 SIDEKIQ_COUNT=4 bundle exec sidekiqswarm -e production -c 25 You are seeing a single Sidek ...
  • Sidekiq Enterprise的多进程功能使这一点变得微不足道。 Sidekiq Enterprise's Multi-Process feature makes this trivial.
  • 通常,您将使用像Gunicorn(第三方软件)之类的东西来帮助您为Django应用程序提供服务。 Gunicorn可以产生多个进程。 对于基本的应用程序设置,大多数人使用三个。 所以,是的。 你的应用程序可能会由nginx背后的多个工作人员提供服务。 Generally, you will use something like Gunicorn (third party software) to help serve your Django app. Gunicorn can spawn multiple ...
  • 我要查看一个漂亮的宝石https://github.com/brandonhilkert/sucker_punch来做到这一点。 根据作者的说法,它是专门为使用Heroku的单一dyno而编写的,用于没有必要旋转另一个dyno的爱好网站。 它基本上创建另一个线程。 仅供参考,有一个附加链接允许sucker_punch执行重复任务,称为https://github.com/facto/fist_of_fury I'm going to check out a nifty gem https://github. ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)