mirror of
https://github.com/matrix-construct/construct
synced 2024-10-06 07:38:52 +02:00
ircd:Ⓜ️:vm: Add opts argument to event commission; comment cleanup.
This commit is contained in:
parent
51fe770d74
commit
1e6d3d3294
2 changed files with 6 additions and 12 deletions
|
@ -29,8 +29,8 @@ namespace ircd::m::vm
|
||||||
extern ctx::shared_view<const event> accept;
|
extern ctx::shared_view<const event> accept;
|
||||||
extern const opts default_opts;
|
extern const opts default_opts;
|
||||||
|
|
||||||
event::id::buf commit(const m::event &);
|
event::id::buf commit(const m::event &, const opts & = default_opts);
|
||||||
event::id::buf commit(json::iov &event, const json::iov &content);
|
event::id::buf commit(json::iov &event, const json::iov &content, const opts & = default_opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Event Evaluation Device
|
/// Event Evaluation Device
|
||||||
|
|
14
ircd/m/vm.cc
14
ircd/m/vm.cc
|
@ -30,17 +30,11 @@ ircd::m::vm::default_opts
|
||||||
|
|
||||||
/// This function takes an event object vector and adds our origin and event_id
|
/// This function takes an event object vector and adds our origin and event_id
|
||||||
/// and hashes and signature and attempts to inject the event into the core.
|
/// and hashes and signature and attempts to inject the event into the core.
|
||||||
/// The caller is expected to have done their best to check if this event will
|
|
||||||
/// succeed once it hits the core because failures blow all this effort. The
|
|
||||||
/// caller's ircd::ctx will obviously yield for evaluation, which may involve
|
|
||||||
/// requests over the internet in the worst case. Nevertheless, the evaluation,
|
|
||||||
/// write and release sequence of the core commitment is designed to allow the
|
|
||||||
/// caller to service a usual HTTP request conveying success or error without
|
|
||||||
/// hanging their client too much.
|
|
||||||
///
|
///
|
||||||
ircd::m::event::id::buf
|
ircd::m::event::id::buf
|
||||||
ircd::m::vm::commit(json::iov &event,
|
ircd::m::vm::commit(json::iov &event,
|
||||||
const json::iov &contents)
|
const json::iov &contents,
|
||||||
|
const opts &opts)
|
||||||
{
|
{
|
||||||
const json::iov::set set[]
|
const json::iov::set set[]
|
||||||
{
|
{
|
||||||
|
@ -99,7 +93,7 @@ ircd::m::vm::commit(json::iov &event,
|
||||||
{ event, { "content", content }},
|
{ event, { "content", content }},
|
||||||
};
|
};
|
||||||
|
|
||||||
return commit(event);
|
return commit(event, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ircd::m::vm
|
namespace ircd::m::vm
|
||||||
|
@ -117,7 +111,7 @@ ircd::m::vm::commit_hook
|
||||||
///
|
///
|
||||||
/// Figure 1:
|
/// Figure 1:
|
||||||
/// in . <-- injection
|
/// in . <-- injection
|
||||||
/// ___:::::::__//
|
/// ===:::::::==//
|
||||||
/// | ||||||| // <-- this function
|
/// | ||||||| // <-- this function
|
||||||
/// | \\|// //|
|
/// | \\|// //|
|
||||||
/// | ||| // | | acceleration
|
/// | ||| // | | acceleration
|
||||||
|
|
Loading…
Reference in a new issue