view release on metacpan or search on metacpan
ext/xxHash/CHANGELOG view on Meta::CPAN
- doc : XXH3 specification (@Adrien1018)
- doc : improved doxygen documentation (@easyaspi314, @t-mat)
- misc : dedicated sanity test binary (@t-mat)
v0.8.1
- perf : much improved performance for XXH3 streaming variants, notably on gcc and msvc
- perf : improved XXH64 speed and latency on small inputs
- perf : small XXH32 speed and latency improvement on small inputs of random size
- perf : minor stack usage improvement for XXH32 and XXH64
- api : new experimental variants XXH3_*_withSecretandSeed()
- api : update XXH3_generateSecret(), can no generate secret of any size (>= XXH3_SECRET_SIZE_MIN)
ext/xxHash/CHANGELOG view on Meta::CPAN
- perf: automatic vector detection and selection at runtime (`xxh_x86dispatch.h`), initiated by @easyaspi314
- perf: added AVX512 support, by @gzm55
- api : new: secret generator `XXH_generateSecret()`, suggested by @koraa
- api : fix: XXH3_state_t is movable, identified by @koraa
- api : fix: state is correctly aligned in AVX mode (unlike `malloc()`), by @easyaspi314
- api : fix: streaming generated wrong values in some combination of random ingestion lengths, reported by @WayneD
- cli : fix unicode print on Windows, by @easyaspi314
- cli : can `-c` check file generated by sfv
- build: `make DISPATCH=1` generates `xxhsum` and `libxxhash` with runtime vector detection (x86/x64 only)
- install: cygwin installation support
- doc : Cryptol specification of XXH32 and XXH64, by @weaversa
view all matches for this distribution
view release on metacpan or search on metacpan
0.41 - 2013-07-29, H.Merijn Brand
* Use File::Spec->tmpdir () for universal existing folder
Note that huge $TMP folders may cause the test to run slow
* Use File::Spec::rel2abs () instead of abs_path and hoops
* Guard against parallel testing, which is unsupported
* Guard against streaming tests (they PASS on the DBI-devel)
0.40 - 2013-07-23, H.Merijn Brand
* Fix version references in doc
* Fix tests for Windows
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/DuckDB/FFI.pm view on Meta::CPAN
duckdb_result_error_type => [['duckdb_result*'] => 'duckdb_error_type'],
# Result Functions
duckdb_result_get_chunk => [['duckdb_result', 'idx_t'] => 'duckdb_data_chunk'],
duckdb_result_is_streaming => [['duckdb_result'] => 'bool'],
duckdb_result_chunk_count => [['duckdb_result'] => 'idx_t'],
duckdb_result_return_type => [['duckdb_result'] => 'duckdb_result_type'],
# Safe Fetch Functions
lib/DBD/DuckDB/FFI.pm view on Meta::CPAN
duckdb_bind_null => [['duckdb_prepared_statement', 'idx_t'] => 'duckdb_state'],
# Execute Prepared Statements
duckdb_execute_prepared => [['duckdb_prepared_statement', 'duckdb_result*'] => 'duckdb_state'],
duckdb_execute_prepared_streaming => [['duckdb_prepared_statement', 'duckdb_result*'] => 'duckdb_state'],
# Extract Statements
duckdb_extract_statements => [['duckdb_connection', 'string', 'duckdb_extracted_statements*'] => 'idx_t'],
duckdb_prepare_extracted_statement => [['duckdb_connection', 'duckdb_extracted_statements', 'idx_t', 'duckdb_prepared_statement*'] => 'duckdb_state'],
lib/DBD/DuckDB/FFI.pm view on Meta::CPAN
duckdb_destroy_extracted => [['duckdb_extracted_statements*'] => 'void'],
# Pending Result Interface
duckdb_pending_prepared => [['duckdb_prepared_statement', 'duckdb_pending_result*'] => 'duckdb_state'],
duckdb_pending_prepared_streaming => [['duckdb_prepared_statement', 'duckdb_pending_result*'] => 'duckdb_state'],
duckdb_destroy_pending => [['duckdb_pending_result*'] => 'void'],
duckdb_pending_error => [['duckdb_pending_result'] => 'string'],
duckdb_pending_execute_task => [['duckdb_pending_result'] => 'duckdb_pending_state'],
duckdb_pending_execute_check_state => [['duckdb_pending_result'] => 'duckdb_pending_state'],
duckdb_execute_pending => [['duckdb_pending_result', 'duckdb_result*'] => 'duckdb_state'],
lib/DBD/DuckDB/FFI.pm view on Meta::CPAN
=over
=item * duckdb_result_get_chunk
=item * duckdb_result_is_streaming
=item * duckdb_result_chunk_count
=item * duckdb_result_return_type
lib/DBD/DuckDB/FFI.pm view on Meta::CPAN
=over
=item * duckdb_execute_prepared
=item * duckdb_execute_prepared_streaming
=back
=head2 Extract Statements
lib/DBD/DuckDB/FFI.pm view on Meta::CPAN
=over
=item * duckdb_pending_prepared
=item * duckdb_pending_prepared_streaming
=item * duckdb_destroy_pending
=item * duckdb_pending_error
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/JDBC.pod view on Meta::CPAN
DBI metadata methods, cancel, row cache.
=item *
Better handling of long fields via some sort of streaming interface.
=item *
JDBC 2.0 support.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/Oracle.pm view on Meta::CPAN
contain, starting at position 100234 in the bin_data column,
the string "This string will overwrite a portion of the blob".
=head3 Example: Streaming character data from the database
In this example, we demonstrate a technique for streaming
data from the database to a file handle, in this case
STDOUT. This allows more data to be read in and written out
than could be stored in memory at a given time.
my $lob_id = 17; # Arbitrary row identifier, for example
view all matches for this distribution
view release on metacpan or search on metacpan
t/03-failover.t view on Meta::CPAN
for my $i ( 1 .. $max_attempts ) {
my $info = get_cluster_info();
next unless $info;
# Count nodes that are running or streaming (replicas in sync)
my @ready =
grep { $_->{state} eq 'running' || $_->{state} eq 'streaming' }
@{ $info->{members} };
if ( @ready >= 3 ) {
diag("All 3 nodes are ready");
return 1;
t/03-failover.t view on Meta::CPAN
my @replicas = @{ $info->{replicas} };
skip "Need at least one replica for cached failover test", 4
unless @replicas;
# Find a replica that is ready (running or streaming)
my ($ready_replica) =
grep { $_->{state} eq 'running' || $_->{state} eq 'streaming' } @replicas;
skip "No ready replica for failover", 4 unless $ready_replica;
my $new_leader = $ready_replica->{name};
diag("Triggering failover to: $new_leader");
t/03-failover.t view on Meta::CPAN
my $info = get_cluster_info();
ok( $info, 'Cluster is accessible' );
ok( $info->{leader}, 'Cluster has a leader' );
# Count running or streaming nodes
my $ready = grep { $_->{state} eq 'running' || $_->{state} eq 'streaming' }
@{ $info->{members} };
diag("Final cluster state:");
diag( " Leader: " . $info->{leader}{host} );
diag(" Ready members: $ready");
view all matches for this distribution
view release on metacpan or search on metacpan
- Aliases for perl_call_*
- Updated to sqlite 2.8.6
- use sqlite_freemem everywhere
0.27
- Changed API to use sqlite streaming API. This makes things slightly
slower for large result sets, at the benefit of being more "sane"
internally.
0.26
- Update to sqlite 2.8.5
view all matches for this distribution
view release on metacpan or search on metacpan
** this function, all changes that relate to a single table are visited
** consecutively. There is no chance that the iterator will visit a change
** the applies to table X, then one for table Y, and then later on visit
** another change for table X.
**
** The behavior of sqlite3changeset_start_v2() and its streaming equivalent
** may be modified by passing a combination of
** [SQLITE_CHANGESETSTART_INVERT | supported flags] as the 4th parameter.
**
** Note that the sqlite3changeset_start_v2() API is still <b>experimental</b>
** and therefore subject to change.
**
** Any number of calls to add() and output() may be made between the calls to
** new() and delete(), and in any order.
**
** As well as the regular sqlite3changegroup_add() and
** sqlite3changegroup_output() functions, also available are the streaming
** versions sqlite3changegroup_add_strm() and sqlite3changegroup_output_strm().
*/
SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup **pp);
/*
** caller to eventually free any such buffer using sqlite3_free(). The buffer
** is only allocated and populated if one or more conflicts were encountered
** while applying the patchset. See comments surrounding the sqlite3_rebaser
** APIs for further details.
**
** The behavior of sqlite3changeset_apply_v2() and its streaming equivalent
** may be modified by passing a combination of
** [SQLITE_CHANGESETAPPLY_NOSAVEPOINT | supported flags] as the 9th parameter.
**
** Note that the sqlite3changeset_apply_v2() API is still <b>experimental</b>
** and therefore subject to change.
SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p);
/*
** CAPI3REF: Streaming Versions of API functions.
**
** The six streaming API xxx_strm() functions serve similar purposes to the
** corresponding non-streaming API functions:
**
** <table border=1 style="margin-left:8ex;margin-right:8ex">
** <tr><th>Streaming function<th>Non-streaming equivalent</th>
** <tr><td>sqlite3changeset_apply_strm<td>[sqlite3changeset_apply]
** <tr><td>sqlite3changeset_apply_strm_v2<td>[sqlite3changeset_apply_v2]
** <tr><td>sqlite3changeset_concat_strm<td>[sqlite3changeset_concat]
** <tr><td>sqlite3changeset_invert_strm<td>[sqlite3changeset_invert]
** <tr><td>sqlite3changeset_start_strm<td>[sqlite3changeset_start]
** <tr><td>sqlite3session_changeset_strm<td>[sqlite3session_changeset]
** <tr><td>sqlite3session_patchset_strm<td>[sqlite3session_patchset]
** </table>
**
** Non-streaming functions that accept changesets (or patchsets) as input
** require that the entire changeset be stored in a single buffer in memory.
** Similarly, those that return a changeset or patchset do so by returning
** a pointer to a single large buffer allocated using sqlite3_malloc().
** Normally this is convenient. However, if an application running in a
** low-memory environment is required to handle very large changesets, the
** large contiguous memory allocations required can become onerous.
**
** In order to avoid this problem, instead of a single large buffer, input
** is passed to a streaming API functions by way of a callback function that
** the sessions module invokes to incrementally request input data as it is
** required. In all cases, a pair of API function parameters such as
**
** <pre>
** int nChangeset,
** error occurs the xInput method should copy up to (*pnData) bytes of data
** into the buffer and set (*pnData) to the actual number of bytes copied
** before returning SQLITE_OK. If the input is completely exhausted, (*pnData)
** should be set to zero to indicate this. Or, if an error occurs, an SQLite
** error code should be returned. In all cases, if an xInput callback returns
** an error, all processing is abandoned and the streaming API function
** returns a copy of the error code to the caller.
**
** In the case of sqlite3changeset_start_strm(), the xInput callback may be
** invoked by the sessions module at any point during the lifetime of the
** iterator. If such an xInput callback returns an error, the iterator enters
** an error state, whereby all subsequent calls to iterator functions
** immediately fail with the same error code as returned by xInput.
**
** Similarly, streaming API functions that return changesets (or patchsets)
** return them in chunks by way of a callback function instead of via a
** pointer to a single large buffer. In this case, a pair of parameters such
** as:
**
** <pre>
** pOut pointer supplied by the application. The second parameter, pData,
** points to a buffer nData bytes in size containing the chunk of output
** data being returned. If the xOutput callback successfully processes the
** supplied data, it should return SQLITE_OK to indicate success. Otherwise,
** it should return some other SQLite error code. In this case processing
** is immediately abandoned and the streaming API function returns a copy
** of the xOutput error code to the application.
**
** The sessions module never invokes an xOutput callback with the third
** parameter set to a value less than or equal to zero. Other than this,
** no guarantees are made as to the size of the chunks of data returned.
** the effect of calling this function depends on the value of the first
** parameter.
**
** <dl>
** <dt>SQLITE_SESSION_CONFIG_STRMSIZE<dd>
** By default, the sessions module streaming interfaces attempt to input
** and output data in approximately 1 KiB chunks. This operand may be used
** to set and query the value of this configuration setting. The pointer
** passed as the second argument must point to a value of type (int).
** If this value is greater than 0, it is used as the new streaming data
** chunk size for both input and output. Before returning, the (int) value
** pointed to by pArg is set to the final value of the streaming interface
** chunk size.
** </dl>
**
** This function returns SQLITE_OK if successful, or an SQLite error code
** otherwise.
typedef struct SessionChange SessionChange;
typedef struct SessionBuffer SessionBuffer;
typedef struct SessionInput SessionInput;
/*
** Minimum chunk size used by streaming versions of functions.
*/
#ifndef SESSIONS_STRM_CHUNK_SIZE
# ifdef SQLITE_TEST
# define SESSIONS_STRM_CHUNK_SIZE 64
# else
** change to contain a field set to "undefined".
**
** REBASE BLOB FORMAT:
**
** A rebase blob may be output by sqlite3changeset_apply_v2() and its
** streaming equivalent for use with the sqlite3_rebaser APIs to rebase
** existing changesets. A rebase blob contains one entry for each conflict
** resolved using either the OMIT or REPLACE strategies within the apply_v2()
** call.
**
** The format used for a rebase blob is very similar to that used for
int bInvert = !!(flags & SQLITE_CHANGESETSTART_INVERT);
return sessionChangesetStart(pp, xInput, pIn, 0, 0, bInvert);
}
/*
** If the SessionInput object passed as the only argument is a streaming
** object and the buffer is full, discard some data to free up space.
*/
static void sessionDiscardData(SessionInput *pIn){
if( pIn->xInput && pIn->iNext>=sessions_strm_chunk_size ){
int nMove = pIn->buf.nBuf - pIn->iNext;
/*
** Serialize a changeset (or patchset) based on all changesets (or patchsets)
** added to the changegroup object passed as the first argument.
**
** If xOutput is not NULL, then the changeset/patchset is returned to the
** user via one or more calls to xOutput, as with the other streaming
** interfaces.
**
** Or, if xOutput is NULL, then (*ppOut) is populated with a pointer to a
** buffer containing the output changeset before this function returns. In
** this case (*pnOut) is set to the size of the output buffer in bytes. It
view all matches for this distribution
view release on metacpan or search on metacpan
sqlite-amalgamation.c view on Meta::CPAN
** leaf layer of the tree.
*/
typedef struct LeavesReader {
int idx; /* Index within the segment. */
sqlite3_stmt *pStmt; /* Statement we're streaming leaves from. */
int eof; /* we've seen SQLITE_DONE from pStmt. */
LeafReader leafReader; /* reader for the current leaf. */
DataBuffer rootData; /* root data for inline. */
} LeavesReader;
view all matches for this distribution
view release on metacpan or search on metacpan
- Aliases for perl_call_*
- Updated to sqlite 2.8.6
- use sqlite_freemem everywhere
0.27
- Changed API to use sqlite streaming API. This makes things slightly
slower for large result sets, at the benefit of being more "sane"
internally.
0.26
- Update to sqlite 2.8.5
view all matches for this distribution
view release on metacpan or search on metacpan
- Aliases for perl_call_*
- Updated to sqlite 2.8.6
- use sqlite_freemem everywhere
0.27
- Changed API to use sqlite streaming API. This makes things slightly
slower for large result sets, at the benefit of being more "sane"
internally.
0.26
- Update to sqlite 2.8.5
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/Wire10.pm view on Meta::CPAN
}
sub take_imp_data {
my $dbh = shift;
# Finish any active statements (important if streaming enabled).
for my $sth (@{$dbh->{ChildHandles} || []}) {
next unless $sth;
$sth->finish if $sth->{Active};
}
lib/DBD/Wire10.pm view on Meta::CPAN
}
}
my $rowcount = eval {
$sth->finish;
my $stream_results = $sth->FETCH('wire10_streaming') || 0;
my $res = $stream_results ? $ps->stream : $ps->query;
die if $wire->get_error_info;
$sth->STORE('wire10_warning_count', $res->get_warning_count);
lib/DBD/Wire10.pm view on Meta::CPAN
}
sub finish {
my $sth = shift;
my $dbh = $sth->{Database};
# If in streaming mode, flush remaining results.
my $iterator = $sth->{wire10_iterator};
$iterator->spool if defined $iterator;
$sth->{wire10_iterator} = undef;
$sth->STORE('Active', 0);
$sth->SUPER::finish;
lib/DBD/Wire10.pm view on Meta::CPAN
Contains the auto_increment value for the last row inserted.
my $id = $sth->{wire10_insertid};
=head4 wire10_streaming
If this is set to 1 (or any value that evaluates to true), results will be streamed from the server rather than downloaded all at once, when the statement is executed.
$sth->{wire10_streaming} = 1;
Notice that the underlying protocol has a limitation: when a streaming statement is active, no other statements can execute on the same connection.
=head4 wire10_warning_count
Contains the number of warnings produced by the last query.
lib/DBD/Wire10.pm view on Meta::CPAN
=head3 Supported C<mysql_> attributes
All of the C<mysql_> attributes are unavailable. DBI requires that each driver uses a unique prefix, therefore this driver supports only attributes named C<wire10_>.
Not all C<mysql_> attributes have equivalently named C<wire10_> attributes. For example, there is no C<mysql_use_result> attribute, but one called C<wire10_streaming> does exactly the same.
=head2 Dependencies
This module requires these other modules and libraries:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/Gofer/Transport/stream.pm view on Meta::CPAN
__END__
=head1 NAME
DBD::Gofer::Transport::stream - DBD::Gofer transport for stdio streaming
=head1 SYNOPSIS
DBI->connect('dbi:Gofer:transport=stream;url=ssh:username@host.example.com;dsn=dbi:...',...)
view all matches for this distribution
view release on metacpan or search on metacpan
doc/rfc3920-notes.txt view on Meta::CPAN
Copyright (C) The Internet Society (2004).
Abstract
This memo defines the core features of the Extensible Messaging and
Presence Protocol (XMPP), a protocol for streaming Extensible Markup
Language (XML) elements in order to exchange structured information
in close to real time between any two network endpoints. While XMPP
provides a generalized, extensible framework for exchanging XML data,
it is used mainly for the purpose of building instant messaging and
presence applications that meet the requirements of RFC 2779.
doc/rfc3920-notes.txt view on Meta::CPAN
11. XML Usage within XMPP
11.1. Restrictions
XMPP is a simplified and specialized protocol for streaming XML
elements in order to exchange structured information in close to real
time. Because XMPP does not require the parsing of arbitrary and
complete XML documents, there is no requirement that XMPP needs to
support the full feature set of [XML]. In particular, the following
restrictions apply.
view all matches for this distribution
view release on metacpan or search on metacpan
* all type keys are inherited by default
* new dta-cab-analysis -analyzer-class=CLASS option
* new Chain::Multi analyzer option 'chain=C1,C2,...' parses user-defined sub-chains
v1.04 2010-09-22 09:38 moocow
* added -block-size=NLINES option to dta-cab-analyze.perl for pseudo-streaming TT analysis
* updated MorphSafe: first- and geonames are now 'safe'
v1.03 2010-05-19 10:36 moocow
* require Unicode::CharName
* updated system/resources using CAB v1.x on uhura (no complete re-build yet)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DTOne/Crypt.pm view on Meta::CPAN
Master key is expected to be exactly 256 bits in length, encoded in base64.
=head2 Performance
Random byte generation on Linux might run slow over time unless L<haveged(8)>
is running. In this scenario, the streaming facility of AES-GCM will be more
memory efficient.
=head1 AUTHOR
Arnold Tan Casis E<lt>atancasis@cpan.orgE<gt>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/StreamData.pm view on Meta::CPAN
chunk at a time. For example, the data could be fetched row by row from a
database server, with each row processed and then dispatched to the client via
the write() method.
The reason for this plugin is that the interface defined by PSGI for data
streaming is annoyingly complex and difficult to work with. By hiding the
complexity, this plugin makes it simple to set up an application which streams
long responses instead of marshalling them into a single response message.
This plugin can be used with any L<PSGI> compatible web server, and includes a
method by which you can check whether the server supports streaming.
=head1 USAGE
=cut
# Between the PSGI interface standard and the way Dancer does things,
# streaming a response involves a callback that returns a callback that is
# passed a callback, none of which are called with the necessary parameters.
# So the easiest way to get the necessary information to the routines that
# need it is to store this information in private variables. Not the most
# elegant solution, but it works. In fact, Dancer itself stores a lot of
# things in private variables.
lib/Dancer/Plugin/StreamData.pm view on Meta::CPAN
register 'stream_data' => sub {
my ($data, $call) = @_;
# First make sure that the server supports streaming
my $env = Dancer::SharedData->request->env;
unless ( $env->{'psgi.streaming'} ) {
croak 'Sorry, this server does not support PSGI streaming.';
}
# Store the parameters for later use by stream_callback()
$stream_object = $data;
lib/Dancer/Plugin/StreamData.pm view on Meta::CPAN
$stream_status = undef;
@stream_headers = ();
# Indicate to Dancer that the response will be streamed, and specify a
# callback to set up the streaming.
my $resp = Dancer::SharedData::response;
$resp->streamed(\&prepare_stream);
my $c = Dancer::Continuation::Route::FileSent->new(return_value => $resp);
lib/Dancer/Plugin/StreamData.pm view on Meta::CPAN
# This routine will be called by Dancer, and will be passed the status code
# and headers that have been determined for the response being assembled. Its
# job is to return a callback that will in turn be called at the proper time
# to begin streaming the data. Unfortunately, it will be called *twice*, the
# second time with an improper status code and headers. Consequently, we must
# ignore the second invocation.
sub prepare_stream {
my ($status, $headers) = @_;
# Store the status and headers we were given, because the callback that
# does the actual streaming will have to present them directly to the PSGI
# interface. We have no way of actually getting that information to it
# other than a private variable (declared above).
# The variable $stream_status is made undefined by the stream_data()
# function (see above) and so we only set it if it has not been set
lib/Dancer/Plugin/StreamData.pm view on Meta::CPAN
}
}
}
# Tell Dancer that it should call the function stream_callback() when
# ready for streaming to begin.
return \&stream_callback;
}
=pod
lib/Dancer/Plugin/StreamData.pm view on Meta::CPAN
erroneously report that the connection was closed prematurely before all of
the data was sent.
=cut
# This subroutine is called at the proper time for data streaming to begin.
# It is passed a callback according to the PSGI standard that can be called to
# procure a writer object to which we can actually write the data a chunk at a
# time. As each chunk is written, it is sent off to the client as part of the
# response body.
lib/Dancer/Plugin/StreamData.pm view on Meta::CPAN
$stream_object->$stream_call($writer);
}
}
=head2 server_supports_streaming
This function returns true if the server you are working with supports
PSGI-style streaming, false otherwise.
Here is an example of how you might use it:
if ( server_supports_streaming ) {
stream_data($query, 'streamResult');
} else {
return $query->generateResult();
}
=cut
register 'server_supports_streaming' => sub {
my $env = Dancer::SharedData->request->env;
return 1 if $env->{'psgi.streaming'};
return undef; # otherwise
};
register_plugin;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer.pm view on Meta::CPAN
my $env = Dancer::SharedData->request->env;
my $request = Dancer::Request->new_for_request('GET' => $path);
Dancer::SharedData->request($request);
# if you asked for streaming but it's not supported in PSGI
if ( $options{'streaming'} && ! $env->{'psgi.streaming'} ) {
# TODO: throw a fit (AKA "exception") or a Dancer::Error?
raise core => 'Sorry, streaming is not supported on this server.';
}
if (exists($options{content_type})) {
$request->content_type($options{content_type});
}
lib/Dancer.pm view on Meta::CPAN
$resp->push_header('Content-Disposition' =>
"attachment; filename=\"$options{filename}\""
);
}
if ( $options{'streaming'} ) {
# handle streaming
$resp->streamed( sub {
my ( $status, $headers ) = @_;
my %callbacks = defined $options{'callbacks'} ?
%{ $options{'callbacks'} } :
();
lib/Dancer.pm view on Meta::CPAN
# This code will be ignored
do_stuff();
}
};
Send file supports streaming possibility using PSGI streaming. The server should
support it but normal streaming is supported on most, if not all.
get '/download/:file' => sub {
send_file( params->{file}, streaming => 1 );
}
You can control what happens using callbacks.
First, C<around_content> allows you to get the writer object and the chunk of
content read, and then decide what to do with each chunk:
get '/download/:file' => sub {
send_file(
params->{file},
streaming => 1,
callbacks => {
around_content => sub {
my ( $writer, $chunk ) = @_;
$writer->write("* $chunk");
},
lib/Dancer.pm view on Meta::CPAN
it:
get '/download/:file' => sub {
send_file(
params->{file},
streaming => 1,
callbacks => {
around => sub {
my ( $writer, $content ) = @_;
# we know it's a text file, so we'll just stream
lib/Dancer.pm view on Meta::CPAN
},
},
);
}
Or you could use C<override> to control the entire streaming callback request:
get '/download/:file' => sub {
send_file(
params->{file},
streaming => 1,
callbacks => {
override => sub {
my ( $respond, $response ) = @_;
my $writer = $respond->( [ $newstatus, $newheaders ] );
lib/Dancer.pm view on Meta::CPAN
42K bytes) using C<bytes>:
get '/download/:file' => sub {
send_file(
params->{file},
streaming => 1,
bytes => 524288, # 512K
);
};
The content-type will be set depending on the current MIME types definition
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/SendAs.pm view on Meta::CPAN
(if necessary). Both the uppercase 'type' and the provided case of the type are
used to find an appropriate serializer class to use.
The implementation of C<send_as> uses Dancer2's C<send_file>. Your route will be
exited immediately when C<send_as> is executed. C<send_file> will stream
content back to the client if your server supports psgi streaming.
=head1 ACKNOWLEDGEMENTS
This module has been written during the
L<Perl Dancer 2015|https://www.perl.dance/> conference.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/WebSocket.pm view on Meta::CPAN
C<Dancer2::Plugin::WebSocket> provides an interface to L<Plack::App::WebSocket>
and allows to interact with the webSocket connections within the Dancer app.
L<Plack::App::WebSocket>, and thus this plugin, requires a plack server that
supports the psgi I<streaming>, I<nonblocking> and I<io>. L<Twiggy>
is the most popular server fitting the bill.
=head1 CONFIGURATION
=over
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Core/App.pm view on Meta::CPAN
# content disposition
( exists $options{filename} )
and $self->response->header( 'Content-Disposition' =>
($options{content_disposition} || "attachment") . "; filename=\"$options{filename}\"" );
# use a delayed response unless server does not support streaming
my $use_streaming = exists $options{streaming} ? $options{streaming} : 1;
my $response;
my $env = $self->request->env;
if ( $env->{'psgi.streaming'} && $use_streaming ) {
my $cb = sub {
my $responder = $Dancer2::Core::Route::RESPONDER;
my $res = $Dancer2::Core::Route::RESPONSE;
return $responder->(
[ $res->status, $res->headers_to_array, $fh ]
view all matches for this distribution
view release on metacpan or search on metacpan
share/assets/dash_table/async~export.js.map view on Meta::CPAN
{"version":3,"sources":["webpack://dash_table/./node_modules/xlsx/xlsx.js","webpack://dash_table/(webpack)/buildin/global.js","webpack://dash_table/./node_modules/process/browser.js","webpack://dash_table/./node_modules/buffer/index.js","webpack://da...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Dump/Streamer.pm view on Meta::CPAN
=item To STREAMER
Specifies the object to print to. Data::Dump::Streamer can stream its
output to any object supporting the print method. This is primarily meant
for streaming to a filehandle, however any object that supports the method
will do.
If a filehandle is specified then it is used until it is explicitly
changed, or the object is destroyed.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Enumerable/Lazy.pm view on Meta::CPAN
item.
=head2 Kafka example
Kafka consumer wrapper is another example of a lazy calculation application.
Lazy enumerables are very naturally co-operated with streaming data, like
Kafka. In this example we're fetching batches of messages from Kafka topic,
grep out corrupted ones and proceed with the mesages.
use Kafka qw($DEFAULT_MAX_BYTES);
use Kafka::Connection;
view all matches for this distribution
view release on metacpan or search on metacpan
* return XXH32(string, length, seed);
* }
* @endcode
*
*
* @anchor streaming_example
* **Streaming**
*
* These groups of functions allow incremental hashing of unknown size, even
* more than what would fit in a size_t.
*
/* ****************************
* Common basic types
******************************/
#include <stddef.h> /* size_t */
/*!
* @brief Exit code for the streaming API.
*/
typedef enum {
XXH_OK = 0, /*!< OK */
XXH_ERROR /*!< Error */
} XXH_errorcode;
XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32 (const void* input, size_t length, XXH32_hash_t seed);
#ifndef XXH_NO_STREAM
/*!
* @typedef struct XXH32_state_s XXH32_state_t
* @brief The opaque state struct for the XXH32 streaming API.
*
* @see XXH32_state_s for details.
* @see @ref streaming_example "Streaming Example"
*/
typedef struct XXH32_state_s XXH32_state_t;
/*!
* @brief Allocates an @ref XXH32_state_t.
* @return An allocated pointer of @ref XXH32_state_t on success.
* @return `NULL` on failure.
*
* @note Must be freed with XXH32_freeState().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_MALLOCF XXH32_state_t* XXH32_createState(void);
/*!
* @brief Frees an @ref XXH32_state_t.
*
*
* @return @ref XXH_OK.
*
* @note @p statePtr must be allocated with XXH32_createState().
*
* @see @ref streaming_example "Streaming Example"
*
*/
XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr);
/*!
* @brief Copies one @ref XXH32_state_t to another.
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note This function resets and seeds a state. Call it before @ref XXH32_update().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, XXH32_hash_t seed);
/*!
* @brief Consumes a block of @p input to an @ref XXH32_state_t.
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note Call this to incrementally consume blocks of data.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);
/*!
* @brief Returns the calculated hash value from an @ref XXH32_state_t.
*
* @note
* Calling XXH32_digest() will not affect @p statePtr, so you can update,
* digest, and update again.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr);
#endif /* !XXH_NO_STREAM */
/******* Canonical representation *******/
XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed);
/******* Streaming *******/
#ifndef XXH_NO_STREAM
/*!
* @brief The opaque state struct for the XXH64 streaming API.
*
* @see XXH64_state_s for details.
* @see @ref streaming_example "Streaming Example"
*/
typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */
/*!
* @brief Allocates an @ref XXH64_state_t.
* @return An allocated pointer of @ref XXH64_state_t on success.
* @return `NULL` on failure.
*
* @note Must be freed with XXH64_freeState().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_MALLOCF XXH64_state_t* XXH64_createState(void);
/*!
* @brief Frees an @ref XXH64_state_t.
*
* @return @ref XXH_OK.
*
* @note @p statePtr must be allocated with XXH64_createState().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr);
/*!
* @brief Copies one @ref XXH64_state_t to another.
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note This function resets and seeds a state. Call it before @ref XXH64_update().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH_NOESCAPE XXH64_state_t* statePtr, XXH64_hash_t seed);
/*!
* @brief Consumes a block of @p input to an @ref XXH64_state_t.
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note Call this to incrementally consume blocks of data.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH_NOESCAPE XXH64_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length);
/*!
* @brief Returns the calculated hash value from an @ref XXH64_state_t.
*
* @note
* Calling XXH64_digest() will not affect @p statePtr, so you can update,
* digest, and update again.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64_digest (XXH_NOESCAPE const XXH64_state_t* statePtr);
#endif /* !XXH_NO_STREAM */
/******* Canonical representation *******/
*
* When only 64 bits are needed, prefer invoking the _64bits variant, as it
* reduces the amount of mixing, resulting in faster speed on small inputs.
* It's also generally simpler to manipulate a scalar return type than a struct.
*
* The API supports one-shot hashing, streaming mode, and custom secrets.
*/
/*!
* @ingroup tuning
* @brief Possible values for @ref XXH_VECTOR.
/******* Streaming *******/
#ifndef XXH_NO_STREAM
/*
* Streaming requires state maintenance.
* This operation costs memory and CPU.
* As a consequence, streaming is slower than one-shot hashing.
* For better performance, prefer one-shot functions whenever applicable.
*/
/*!
* @brief The opaque state struct for the XXH3 streaming API.
*
* @see XXH3_state_s for details.
* @see @ref streaming_example "Streaming Example"
*/
typedef struct XXH3_state_s XXH3_state_t;
XXH_PUBLIC_API XXH_MALLOCF XXH3_state_t* XXH3_createState(void);
XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr);
* @note
* - This function resets `statePtr` and generate a secret with default parameters.
* - Call this function before @ref XXH3_64bits_update().
* - Digest will be equivalent to `XXH3_64bits()`.
*
* @see @ref streaming_example "Streaming Example"
*
*/
XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr);
/*!
* @note
* - This function resets `statePtr` and generate a secret from `seed`.
* - Call this function before @ref XXH3_64bits_update().
* - Digest will be equivalent to `XXH3_64bits_withSeed()`.
*
* @see @ref streaming_example "Streaming Example"
*
*/
XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed);
/*!
*
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note
* `secret` is referenced, it _must outlive_ the hash streaming session.
*
* Similar to one-shot API, `secretSize` must be >= @ref XXH3_SECRET_SIZE_MIN,
* and the quality of produced hash values depends on secret's entropy
* (secret's content should look like a bunch of random bytes).
* When in doubt about the randomness of a candidate `secret`,
* consider employing `XXH3_generateSecret()` instead (see below).
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize);
/*!
* @brief Consumes a block of @p input to an @ref XXH3_state_t.
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note Call this to incrementally consume blocks of data.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_64bits_update (XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length);
/*!
* @brief Returns the calculated XXH3 64-bit hash value from an @ref XXH3_state_t.
*
* @note
* Calling XXH3_64bits_digest() will not affect @p statePtr, so you can update,
* digest, and update again.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits_digest (XXH_NOESCAPE const XXH3_state_t* statePtr);
#endif /* !XXH_NO_STREAM */
/* note : canonical representation of XXH3 is the same as XXH64
/******* Streaming *******/
#ifndef XXH_NO_STREAM
/*
* Streaming requires state maintenance.
* This operation costs memory and CPU.
* As a consequence, streaming is slower than one-shot hashing.
* For better performance, prefer one-shot functions whenever applicable.
*
* XXH3_128bits uses the same XXH3_state_t as XXH3_64bits().
* Use already declared XXH3_createState() and XXH3_freeState().
*
* All reset and streaming functions have same meaning as their 64-bit counterpart.
*/
/*!
* @brief Resets an @ref XXH3_state_t to begin a new hash.
*
* @note
* - This function resets `statePtr` and generate a secret with default parameters.
* - Call it before @ref XXH3_128bits_update().
* - Digest will be equivalent to `XXH3_128bits()`.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr);
/*!
* @brief Resets an @ref XXH3_state_t with 64-bit seed to begin a new hash.
* @note
* - This function resets `statePtr` and generate a secret from `seed`.
* - Call it before @ref XXH3_128bits_update().
* - Digest will be equivalent to `XXH3_128bits_withSeed()`.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed);
/*!
* @brief Resets an @ref XXH3_state_t with secret data to begin a new hash.
*
* @p statePtr must not be `NULL`.
*
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* `secret` is referenced, it _must outlive_ the hash streaming session.
* Similar to one-shot API, `secretSize` must be >= @ref XXH3_SECRET_SIZE_MIN,
* and the quality of produced hash values depends on secret's entropy
* (secret's content should look like a bunch of random bytes).
* When in doubt about the randomness of a candidate `secret`,
* consider employing `XXH3_generateSecret()` instead (see below).
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize);
/*!
* @brief Consumes a block of @p input to an @ref XXH3_state_t.
* Never **ever** access their members directly.
*/
/*!
* @internal
* @brief Structure for XXH32 streaming API.
*
* @note This is only defined when @ref XXH_STATIC_LINKING_ONLY,
* @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined. Otherwise it is
* an opaque type. This allows fields to safely be changed.
*
#ifndef XXH_NO_LONG_LONG /* defined when there is no 64-bit support */
/*!
* @internal
* @brief Structure for XXH64 streaming API.
*
* @note This is only defined when @ref XXH_STATIC_LINKING_ONLY,
* @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined. Otherwise it is
* an opaque type. This allows fields to safely be changed.
*
*/
#define XXH3_SECRET_DEFAULT_SIZE 192
/*!
* @internal
* @brief Structure for XXH3 streaming API.
*
* @note This is only defined when @ref XXH_STATIC_LINKING_ONLY,
* @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined.
* Otherwise it is an opaque type.
* Never use this definition in combination with dynamic library.
* When the @ref XXH3_state_t structure is merely emplaced on stack,
* it should be initialized with XXH3_INITSTATE() or a memset()
* in case its first reset uses XXH3_NNbits_reset_withSeed().
* This init can be omitted if the first reset uses default or _withSecret mode.
* This operation isn't necessary when the state is created with XXH3_createState().
* Note that this doesn't prepare the state for a streaming operation,
* it's still necessary to use XXH3_NNbits_reset*() afterwards.
*/
#define XXH3_INITSTATE(XXH3_state_ptr) \
do { \
XXH3_state_t* tmp_xxh3_state_ptr = (XXH3_state_ptr); \
* conservative and disables hacks that increase code size. It implies the
* options @ref XXH_NO_INLINE_HINTS == 1, @ref XXH_FORCE_ALIGN_CHECK == 0,
* and @ref XXH3_NEON_LANES == 8 if they are not already defined.
* - `XXH_SIZE_OPT` == 2: xxHash tries to make itself as small as possible.
* Performance may cry. For example, the single shot functions just use the
* streaming API.
*/
# define XXH_SIZE_OPT 0
/*!
* @def XXH_FORCE_ALIGN_CHECK
# define XXH_OLD_NAMES
# undef XXH_OLD_NAMES /* don't actually use, it is ugly. */
/*!
* @def XXH_NO_STREAM
* @brief Disables the streaming API.
*
* When xxHash is not inlined and the streaming functions are not used, disabling
* the streaming functions can improve code size significantly, especially with
* the @ref XXH3_family which tends to make constant folded copies of itself.
*/
# define XXH_NO_STREAM
# undef XXH_NO_STREAM /* don't actually */
#endif /* XXH_DOXYGEN */
#endif
}
/******* Hash streaming *******/
#ifndef XXH_NO_STREAM
/*! @ingroup XXH32_family */
XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void)
{
return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t));
return XXH3_64bits_internal(input, length, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL);
return XXH3_hashLong_64b_withSecret(input, length, seed, (const xxh_u8*)secret, secretSize);
}
/* === XXH3 streaming === */
#ifndef XXH_NO_STREAM
/*
* Malloc's a pointer that is always aligned to @align.
*
* This must be freed with `XXH_alignedFree()`.
* @return An allocated pointer of @ref XXH3_state_t on success.
* @return `NULL` on failure.
*
* @note Must be freed with XXH3_freeState().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH3_state_t* XXH3_createState(void)
{
XXH3_state_t* const state = (XXH3_state_t*)XXH_alignedMalloc(sizeof(XXH3_state_t), 64);
if (state==NULL) return NULL;
*
* @return @ref XXH_OK.
*
* @note Must be allocated with XXH3_createState().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr)
{
XXH_alignedFree(statePtr);
return XXH_OK;
{
return XXH3_128bits_withSeed(input, len, seed);
}
/* === XXH3 128-bit streaming === */
#ifndef XXH_NO_STREAM
/*
* All initialization and update functions are identical to 64-bit streaming variant.
* The only difference is the finalization routine.
*/
/*! @ingroup XXH3_family */
XXH_PUBLIC_API XXH_errorcode
view all matches for this distribution
view release on metacpan or search on metacpan
* return XXH32(string, length, seed);
* }
* @endcode
*
*
* @anchor streaming_example
* **Streaming**
*
* These groups of functions allow incremental hashing of unknown size, even
* more than what would fit in a size_t.
*
/* ****************************
* Common basic types
******************************/
#include <stddef.h> /* size_t */
/*!
* @brief Exit code for the streaming API.
*/
typedef enum {
XXH_OK = 0, /*!< OK */
XXH_ERROR /*!< Error */
} XXH_errorcode;
XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32 (const void* input, size_t length, XXH32_hash_t seed);
#ifndef XXH_NO_STREAM
/*!
* @typedef struct XXH32_state_s XXH32_state_t
* @brief The opaque state struct for the XXH32 streaming API.
*
* @see XXH32_state_s for details.
* @see @ref streaming_example "Streaming Example"
*/
typedef struct XXH32_state_s XXH32_state_t;
/*!
* @brief Allocates an @ref XXH32_state_t.
* @return An allocated pointer of @ref XXH32_state_t on success.
* @return `NULL` on failure.
*
* @note Must be freed with XXH32_freeState().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_MALLOCF XXH32_state_t* XXH32_createState(void);
/*!
* @brief Frees an @ref XXH32_state_t.
*
*
* @return @ref XXH_OK.
*
* @note @p statePtr must be allocated with XXH32_createState().
*
* @see @ref streaming_example "Streaming Example"
*
*/
XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr);
/*!
* @brief Copies one @ref XXH32_state_t to another.
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note This function resets and seeds a state. Call it before @ref XXH32_update().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, XXH32_hash_t seed);
/*!
* @brief Consumes a block of @p input to an @ref XXH32_state_t.
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note Call this to incrementally consume blocks of data.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);
/*!
* @brief Returns the calculated hash value from an @ref XXH32_state_t.
*
* @note
* Calling XXH32_digest() will not affect @p statePtr, so you can update,
* digest, and update again.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr);
#endif /* !XXH_NO_STREAM */
/******* Canonical representation *******/
XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed);
/******* Streaming *******/
#ifndef XXH_NO_STREAM
/*!
* @brief The opaque state struct for the XXH64 streaming API.
*
* @see XXH64_state_s for details.
* @see @ref streaming_example "Streaming Example"
*/
typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */
/*!
* @brief Allocates an @ref XXH64_state_t.
* @return An allocated pointer of @ref XXH64_state_t on success.
* @return `NULL` on failure.
*
* @note Must be freed with XXH64_freeState().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_MALLOCF XXH64_state_t* XXH64_createState(void);
/*!
* @brief Frees an @ref XXH64_state_t.
*
* @return @ref XXH_OK.
*
* @note @p statePtr must be allocated with XXH64_createState().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr);
/*!
* @brief Copies one @ref XXH64_state_t to another.
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note This function resets and seeds a state. Call it before @ref XXH64_update().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH_NOESCAPE XXH64_state_t* statePtr, XXH64_hash_t seed);
/*!
* @brief Consumes a block of @p input to an @ref XXH64_state_t.
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note Call this to incrementally consume blocks of data.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH_NOESCAPE XXH64_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length);
/*!
* @brief Returns the calculated hash value from an @ref XXH64_state_t.
*
* @note
* Calling XXH64_digest() will not affect @p statePtr, so you can update,
* digest, and update again.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64_digest (XXH_NOESCAPE const XXH64_state_t* statePtr);
#endif /* !XXH_NO_STREAM */
/******* Canonical representation *******/
*
* When only 64 bits are needed, prefer invoking the _64bits variant, as it
* reduces the amount of mixing, resulting in faster speed on small inputs.
* It's also generally simpler to manipulate a scalar return type than a struct.
*
* The API supports one-shot hashing, streaming mode, and custom secrets.
*/
/*!
* @ingroup tuning
* @brief Possible values for @ref XXH_VECTOR.
/******* Streaming *******/
#ifndef XXH_NO_STREAM
/*
* Streaming requires state maintenance.
* This operation costs memory and CPU.
* As a consequence, streaming is slower than one-shot hashing.
* For better performance, prefer one-shot functions whenever applicable.
*/
/*!
* @brief The opaque state struct for the XXH3 streaming API.
*
* @see XXH3_state_s for details.
* @see @ref streaming_example "Streaming Example"
*/
typedef struct XXH3_state_s XXH3_state_t;
XXH_PUBLIC_API XXH_MALLOCF XXH3_state_t* XXH3_createState(void);
XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr);
* @note
* - This function resets `statePtr` and generate a secret with default parameters.
* - Call this function before @ref XXH3_64bits_update().
* - Digest will be equivalent to `XXH3_64bits()`.
*
* @see @ref streaming_example "Streaming Example"
*
*/
XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr);
/*!
* @note
* - This function resets `statePtr` and generate a secret from `seed`.
* - Call this function before @ref XXH3_64bits_update().
* - Digest will be equivalent to `XXH3_64bits_withSeed()`.
*
* @see @ref streaming_example "Streaming Example"
*
*/
XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed);
/*!
*
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note
* `secret` is referenced, it _must outlive_ the hash streaming session.
*
* Similar to one-shot API, `secretSize` must be >= @ref XXH3_SECRET_SIZE_MIN,
* and the quality of produced hash values depends on secret's entropy
* (secret's content should look like a bunch of random bytes).
* When in doubt about the randomness of a candidate `secret`,
* consider employing `XXH3_generateSecret()` instead (see below).
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize);
/*!
* @brief Consumes a block of @p input to an @ref XXH3_state_t.
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* @note Call this to incrementally consume blocks of data.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_64bits_update (XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length);
/*!
* @brief Returns the calculated XXH3 64-bit hash value from an @ref XXH3_state_t.
*
* @note
* Calling XXH3_64bits_digest() will not affect @p statePtr, so you can update,
* digest, and update again.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits_digest (XXH_NOESCAPE const XXH3_state_t* statePtr);
#endif /* !XXH_NO_STREAM */
/* note : canonical representation of XXH3 is the same as XXH64
/******* Streaming *******/
#ifndef XXH_NO_STREAM
/*
* Streaming requires state maintenance.
* This operation costs memory and CPU.
* As a consequence, streaming is slower than one-shot hashing.
* For better performance, prefer one-shot functions whenever applicable.
*
* XXH3_128bits uses the same XXH3_state_t as XXH3_64bits().
* Use already declared XXH3_createState() and XXH3_freeState().
*
* All reset and streaming functions have same meaning as their 64-bit counterpart.
*/
/*!
* @brief Resets an @ref XXH3_state_t to begin a new hash.
*
* @note
* - This function resets `statePtr` and generate a secret with default parameters.
* - Call it before @ref XXH3_128bits_update().
* - Digest will be equivalent to `XXH3_128bits()`.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr);
/*!
* @brief Resets an @ref XXH3_state_t with 64-bit seed to begin a new hash.
* @note
* - This function resets `statePtr` and generate a secret from `seed`.
* - Call it before @ref XXH3_128bits_update().
* - Digest will be equivalent to `XXH3_128bits_withSeed()`.
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed);
/*!
* @brief Resets an @ref XXH3_state_t with secret data to begin a new hash.
*
* @p statePtr must not be `NULL`.
*
* @return @ref XXH_OK on success.
* @return @ref XXH_ERROR on failure.
*
* `secret` is referenced, it _must outlive_ the hash streaming session.
* Similar to one-shot API, `secretSize` must be >= @ref XXH3_SECRET_SIZE_MIN,
* and the quality of produced hash values depends on secret's entropy
* (secret's content should look like a bunch of random bytes).
* When in doubt about the randomness of a candidate `secret`,
* consider employing `XXH3_generateSecret()` instead (see below).
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize);
/*!
* @brief Consumes a block of @p input to an @ref XXH3_state_t.
* Never **ever** access their members directly.
*/
/*!
* @internal
* @brief Structure for XXH32 streaming API.
*
* @note This is only defined when @ref XXH_STATIC_LINKING_ONLY,
* @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined. Otherwise it is
* an opaque type. This allows fields to safely be changed.
*
#ifndef XXH_NO_LONG_LONG /* defined when there is no 64-bit support */
/*!
* @internal
* @brief Structure for XXH64 streaming API.
*
* @note This is only defined when @ref XXH_STATIC_LINKING_ONLY,
* @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined. Otherwise it is
* an opaque type. This allows fields to safely be changed.
*
*/
#define XXH3_SECRET_DEFAULT_SIZE 192
/*!
* @internal
* @brief Structure for XXH3 streaming API.
*
* @note This is only defined when @ref XXH_STATIC_LINKING_ONLY,
* @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined.
* Otherwise it is an opaque type.
* Never use this definition in combination with dynamic library.
* When the @ref XXH3_state_t structure is merely emplaced on stack,
* it should be initialized with XXH3_INITSTATE() or a memset()
* in case its first reset uses XXH3_NNbits_reset_withSeed().
* This init can be omitted if the first reset uses default or _withSecret mode.
* This operation isn't necessary when the state is created with XXH3_createState().
* Note that this doesn't prepare the state for a streaming operation,
* it's still necessary to use XXH3_NNbits_reset*() afterwards.
*/
#define XXH3_INITSTATE(XXH3_state_ptr) \
do { \
XXH3_state_t* tmp_xxh3_state_ptr = (XXH3_state_ptr); \
* conservative and disables hacks that increase code size. It implies the
* options @ref XXH_NO_INLINE_HINTS == 1, @ref XXH_FORCE_ALIGN_CHECK == 0,
* and @ref XXH3_NEON_LANES == 8 if they are not already defined.
* - `XXH_SIZE_OPT` == 2: xxHash tries to make itself as small as possible.
* Performance may cry. For example, the single shot functions just use the
* streaming API.
*/
# define XXH_SIZE_OPT 0
/*!
* @def XXH_FORCE_ALIGN_CHECK
# define XXH_OLD_NAMES
# undef XXH_OLD_NAMES /* don't actually use, it is ugly. */
/*!
* @def XXH_NO_STREAM
* @brief Disables the streaming API.
*
* When xxHash is not inlined and the streaming functions are not used, disabling
* the streaming functions can improve code size significantly, especially with
* the @ref XXH3_family which tends to make constant folded copies of itself.
*/
# define XXH_NO_STREAM
# undef XXH_NO_STREAM /* don't actually */
#endif /* XXH_DOXYGEN */
#endif
}
/******* Hash streaming *******/
#ifndef XXH_NO_STREAM
/*! @ingroup XXH32_family */
XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void)
{
return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t));
return XXH3_64bits_internal(input, length, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL);
return XXH3_hashLong_64b_withSecret(input, length, seed, (const xxh_u8*)secret, secretSize);
}
/* === XXH3 streaming === */
#ifndef XXH_NO_STREAM
/*
* Malloc's a pointer that is always aligned to @align.
*
* This must be freed with `XXH_alignedFree()`.
* @return An allocated pointer of @ref XXH3_state_t on success.
* @return `NULL` on failure.
*
* @note Must be freed with XXH3_freeState().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH3_state_t* XXH3_createState(void)
{
XXH3_state_t* const state = (XXH3_state_t*)XXH_alignedMalloc(sizeof(XXH3_state_t), 64);
if (state==NULL) return NULL;
*
* @return @ref XXH_OK.
*
* @note Must be allocated with XXH3_createState().
*
* @see @ref streaming_example "Streaming Example"
*/
XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr)
{
XXH_alignedFree(statePtr);
return XXH_OK;
{
return XXH3_128bits_withSeed(input, len, seed);
}
/* === XXH3 128-bit streaming === */
#ifndef XXH_NO_STREAM
/*
* All initialization and update functions are identical to 64-bit streaming variant.
* The only difference is the finalization routine.
*/
/*! @ingroup XXH3_family */
XXH_PUBLIC_API XXH_errorcode
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/MessagePack/Stream.pm view on Meta::CPAN
=for stopwords
messagepack deserializer parsable unpacker unpacker's
=head1 NAME
Data::MessagePack::Stream - yet another messagepack streaming deserializer
=head1 SYNOPSIS
use Data::Dumper;
my $unpacker = Data::MessagePack::Stream->new;
lib/Data/MessagePack/Stream.pm view on Meta::CPAN
}
}
=head1 DESCRIPTION
Data::MessagePack::Stream is streaming deserializer for MessagePack.
This module is alternate for L<Data::MessagePack::Unpacker>.
Unlike original unpacker, this module support internal buffer and it's possible to handle streaming data correctly.
=head1 METHODS
=head2 new
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/MessagePack.pm view on Meta::CPAN
The MessagePack format saves memory than JSON and Storable format.
=item STREAMING DESERIALIZER
MessagePack supports streaming deserializer. It is useful for
networking such as RPC. See L<Data::MessagePack::Unpacker> for
details.
=back
lib/Data/MessagePack.pm view on Meta::CPAN
MessagePack cannot deal with complex scalars such as object references,
filehandles, and code references. We should report the errors more kindly.
=item Streaming deserializer
The current implementation of the streaming deserializer does not have internal
buffers while some other bindings (such as Ruby binding) does. This limitation
will astonish those who try to unpack byte streams with an arbitrary buffer size
(e.g. C<< while(read($socket, $buffer, $arbitrary_buffer_size)) { ... } >>).
We should implement the internal buffer for the unpacker.
view all matches for this distribution
view release on metacpan or search on metacpan
signup_form.html view on Meta::CPAN
</div>
<div class="select label">
<label for="source_type_user_reported">How did you hear about us?</label>
<select name="source_type_user_reported" class="source_type_user_reported" data-where-field="source_type_user_reported_specific" id="source_type_user_reported">
<option value="">- How did you hear about us? -</option>
<option value="streaming" data-where="Which streaming service did you hear us on? (optional)">Streaming Audio (e.g. Spotify)</option>
<option value="tv" data-where="Which TV station did you see us on? (optional)">TV</option>
<option value="search_engine">Search Engine</option>
<option value="mail" data-where="Offer code (optional)">In the Mail</option>
<option value="radio_or_podcast" data-where="Which radio station did you hear us on? (optional)">Radio (AM/FM/XM)</option>
<option value="magazine_ad" data-where="Offer code (optional)">Magazine ad / insert</option>
view all matches for this distribution
view release on metacpan or search on metacpan
share/dictionary.txt view on Meta::CPAN
mainstay's
mainstays
mainstream
mainstream's
mainstreamed
mainstreaming
mainstreams
maintain
maintainability
maintainable
maintained
share/dictionary.txt view on Meta::CPAN
stream's
streamed
streamer
streamer's
streamers
streaming
streaming's
streamline
streamline's
streamlined
streamlines
streamlining
share/dictionary.txt view on Meta::CPAN
upstarting
upstarts
upstate
upstream
upstreamed
upstreaming
upstreams
upsurge
upsurged
upsurges
upsurging
view all matches for this distribution