<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Behaviour on PlumePHP</title><link>https://plumephp.com/tags/behaviour/</link><description>Recent content in Behaviour on PlumePHP</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Mon, 28 Sep 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://plumephp.com/tags/behaviour/index.xml" rel="self" type="application/rss+xml"/><item><title>自定义 OTP Behaviour 实战：Callback 规范与行为封装</title><link>https://plumephp.com/erlang-behaviour-custom/</link><pubDate>Mon, 28 Sep 2026 10:00:00 +0800</pubDate><guid>https://plumephp.com/erlang-behaviour-custom/</guid><description>&lt;h2 id="引言"&gt;引言&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;gen_server&lt;/code&gt;、&lt;code&gt;gen_statem&lt;/code&gt;、&lt;code&gt;supervisor&lt;/code&gt; 这些 OTP 行为（behaviour）把「进程骨架」固定下来，你只需填回调。&lt;strong&gt;自定义 behaviour&lt;/strong&gt; 是把这种「骨架 + 契约」模式复用到你自己的领域——定义回调规范，让团队按统一套路实现模块。本文讲清 behaviour 机制：callback 声明、契约检查、行为实现，以及何时该自定义 behaviour。&lt;/p&gt;</description></item></channel></rss>