-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow pre-parsing of ESI document, add example of fetching per-user fragment variants #30
base: main
Are you sure you want to change the base?
Conversation
…t URLs per-request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor details
@@ -140,9 +169,8 @@ impl Processor { | |||
); | |||
|
|||
// `root_task` is the root task that will be used to fetch tags in recursive manner | |||
let root_task = &mut Task::new(); | |||
let root_task: &mut Task = &mut Task::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is pretty obvious and no more explicit notation required.
# This file describes a Fastly Compute package. To learn more visit: | ||
# https://developer.fastly.com/reference/fastly-toml/ | ||
|
||
authors = ["[email protected]"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
authors = ["kailan@enviark.com"] | |
authors = ["kblanks@fastly.com"] |
I think we usually leaving those empty or with fastly emails, no?
use std::{ | ||
collections::{HashMap, VecDeque}, | ||
io::Write, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use VecDeque
use std::{ | |
collections::{HashMap, VecDeque}, | |
io::Write, | |
}; | |
use std::{collections::HashMap, io::Write}; | |
}; |
let mut xml_writer = Writer::new(output_writer); | ||
|
||
// Parse the ESI document and store it in memory | ||
let mut events = VecDeque::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use VecDeque
let mut events = VecDeque::new(); | |
let mut events = Vec::new(); |
let mut events = VecDeque::new(); | ||
let mut beresp_reader = Reader::from_reader(beresp.take_body()); | ||
parse_tags("esi", &mut beresp_reader, &mut |event| { | ||
events.push_back(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use VecDeque
events.push_back(event); | |
events.push(event); |
|
||
// Process the already-parsed ESI document, replacing the request URLs with the variant URLs | ||
let result = processor.process_parsed_document( | ||
events, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use VecDeque
events, | |
events.into(), |
Resolves #3