Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
ec8edeca
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ec8edeca
编写于
11月 27, 2014
作者:
X
Xavier Noria
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
edits in the release notes for 4.2
上级
b2351bea
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
12 deletion
+22
-12
guides/source/4_2_release_notes.md
guides/source/4_2_release_notes.md
+22
-12
未找到文件。
guides/source/4_2_release_notes.md
浏览文件 @
ec8edeca
...
...
@@ -3,7 +3,8 @@ Ruby on Rails 4.2 Release Notes
Highlights in Rails 4.2:
*
Active Job, Action Mailer's
`deliver_later`
*
Active Job
*
Asynchronous Mails
*
Adequate Record
*
Web Console
*
Foreign key support
...
...
@@ -29,7 +30,7 @@ Rails](upgrading_ruby_on_rails.html#upgrading-from-rails-4-1-to-rails-4-2).
Major Features
--------------
### Active Job
, Action Mailer's `deliver_later`
### Active Job
Active Job is a new framework in Rails 4.2. It is a common interface on top of
queuing systems like
[
Resque
](
https://github.com/resque/resque
)
,
[
Delayed
...
...
@@ -40,20 +41,25 @@ Jobs written with the Active Job API run on any of the supported queues thanks
to their respective adapters. Active Job comes pre-configured with an inline
runner that executes jobs right away.
Building on top of Active Job, Action Mailer now comes with a
`deliver_later`
method that sends the email asynchronously via a job in a queue, so it doesn't
block the controller or model.
The new
[
Global ID
](
https://github.com/rails/globalid
)
library makes it easy
to pass Active Record objects to jobs. The library stores a global URI that
uniquely represents the model without serializing its state. This means you no
longer have to manually pack and unpack your Active Records by passing ids.
Just give the job the Active Record object, its global ID will be stored, and
then the object transparently loaded for you from it.
Jobs often need to take Active Record objects as arguments, but we can't pass
fully-marshaled Ruby objects through many queueing systems. Active Job passes
object references as URIs (uniform resource identifiers) instead of marshaling
the object itself. The new
[
Global ID
](
https://github.com/rails/globalid
)
library builds URIs and looks up the objects they reference. Passing Active
Record objects as job arguments "just works:" Active Job passes a reference to
the object, then looks up the object from its reference.
See the
[
Active Job Basics
](
active_job_basics.html
)
guide for more
information.
### Asynchronous Mails
Building on top of Active Job, Action Mailer now comes with a
`deliver_later`
method that sends emails via the queue, so it doesn't block the controller or
model if the queue is asynchronous (the default inline queue blocks).
Sending emails right away is still possible with
`deliver_now`
.
### Adequate Record
Adequate Record is a set of performance improvements in Active Record that makes
...
...
@@ -554,6 +560,10 @@ Please refer to the [Changelog][action-mailer] for detailed changes.
to deliver emails asynchronously.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16485
)
)
*
Introduced
`deliver_now`
to send emails right away, without going through
the application's queue.
(
[
Commit
](
https://github.com/rails/rails/commit/f4ee114746ddc68db606f63e17e6de28274fc2bd
)
)
*
Added the
`show_previews`
configuration option for enabling mailer previews
outside of the development environment.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15970
)
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录